Multi-tab in message extension like shown in the microsoft documentation - c#

How can I add multiple tab in message extension in Bot Framework using C# like as shown in this image here ?
enter image description here

You can add it by adding multiple search commands in the manifest file. Sharing part of JSON below.
"composeExtensions": [
{
"botId": "448ec85c-4395-4f80-b5a1-cd3bdefd1f5b",
"canUpdateConfiguration": true,
"commands": [
{
"id": "searchQuery",
"context": [
"compose",
"commandBox"
],
"description": "Test command to run query",
"title": "Search",
"type": "query",
"initialRun": true,
"parameters": [
{
"name": "searchQuery",
"title": "Search Query",
"description": "Your search query",
"inputType": "text"
}
]
},
{
"id": "searchQuery2",
"context": [
"compose",
"commandBox"
],
"description": "Test command to run query2",
"title": "Search2",
"type": "query",
"initialRun": true,
"parameters": [
{
"name": "searchQuery2",
"title": "Search Query2",
"description": "Your search query2",
"inputType": "text"
}
]
},
{
"id": "searchQuery3",
"context": [
"compose",
"commandBox"
],
"description": "Test command to run query",
"title": "Search3",
"type": "query",
"initialRun": true,
"parameters": [
{
"name": "searchQuery3",
"title": "Search Query3",
"description": "Your search query3",
"inputType": "text"
}
]
}
]
Here is the sample - https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/50.teams-messaging-extensions-search

Related

Trying to setup diagnostic settings for activity logs in ARM template

I've been trying to create a template for a logger function app in Azure, the basic idea is that it'll forward all activity log category info along with all audit log info using event hubs as triggers, I've gotten down most of the template, but I keep hitting the following error when it comes to the diagnostic settings part:
The resource type '/' does not support diagnostic settings.
Is there something I'm doing wrong? I've only started working with azure for a short while, and am afraid I'm misunderstanding how diagnostic settings are created in an ARM template. I can't seem to find any template or documentation online about this, and am at a loss...
Here's an excerpt:
...
"variables": {
"eventHubNamespaceName": "azure-logger",
"auditEventHubName": "[concat(variables('eventHubNamespaceName'), '/', 'audit-logs')]",
"activityEventHubName": "[concat(variables('eventHubNamespaceName'), '/', 'activity-logs')]",
"authRuleResourceId": "[resourceId('Microsoft.Eventhub/namespaces/authorizationRules', variables('eventHubNamespaceName'), 'RootManageSharedAccessKey')]",
"auditAuthorizationRuleId": "[resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('eventHubNamespaceName') , 'audit-logs', 'default')]",
"activityAuthorizationRuleId": "[resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('eventHubNamespaceName') , 'activity-logs', 'default')]"
},
"resources": [
{
"name": "[variables('eventHubNamespaceName')]",
"type": "Microsoft.EventHub/namespaces",
"apiVersion": "2021-06-01-preview",
"location": "[parameters('location')]",
"sku": {
"name": "Standard"
},
"identity": {
"type": "SystemAssigned"
},
"properties": {
"status": "Active"
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces/eventhubs",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'audit-logs')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', variables('eventHubNamespaceName'))]"
],
"properties": {
"messageRetentionInDays": 1,
"partitionCount": 1
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces/eventhubs/authorizationRules",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'audit-logs','/','default')]",
"properties": {
"rights": [ "Manage", "Listen", "Send" ]
},
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces/eventhubs', variables('eventHubNamespaceName'), 'audit-logs')]"
]
}
]
},
{
"type": "Microsoft.EventHub/namespaces/eventhubs",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'activity-logs')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', variables('eventHubNamespaceName'))]"
],
"properties": {
"messageRetentionInDays": 1,
"partitionCount": 1
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces/eventhubs/authorizationRules",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'activity-logs','/','default')]",
"properties": {
"rights": [ "Manage", "Listen", "Send" ]
},
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces/eventhubs', variables('eventHubNamespaceName'), 'activity-logs')]"
]
}
]
}
]
},
{
"type": "Microsoft.Insights/diagnosticSettings",
"apiVersion": "2017-05-01-preview",
"name": "[concat(variables('eventHubNamespaceName'),'activity-logs')]",
"properties": {
"eventHubName": "activity-logs",
"eventHubAuthorizationRuleId": "[variables('activityAuthorizationRuleId')]",
"logs": [
{
"category": "Administrative",
"enabled": true
},
{
"category": "Security",
"enabled": true
},
{
"category": "ServiceHealth",
"enabled": true
},
{
"category": "Alert",
"enabled": true
},
{
"category": "Recommendation",
"enabled": true
},
{
"category": "Policy",
"enabled": true
},
{
"category": "Autoscale",
"enabled": true
},
{
"category": "ResourceHealth",
"enabled": true
}
]
}
}
]
...```
Diagnostic settings for Activity logs are created for a subscription, not for a resource group like settings for Azure resources. Therefore, when you check the Diagnostic setting for Activity log in this document, you will find that you can deploy Azure Resource Manager templates using any valid method including PowerShell and CLI. Diagnostic settings for Activity log must deploy to a subscription using az deployment create for CLI or New-AzDeployment for PowerShell.
And the template should look like as following :
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"settingName": {
"type": "String"
},
"workspaceId": {
"type": "String"
},
"storageAccountId": {
"type": "String"
},
"eventHubAuthorizationRuleId": {
"type": "String"
},
"eventHubName": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.Insights/diagnosticSettings",
"apiVersion": "2017-05-01-preview",
"name": "[parameters('settingName')]",
"properties": {
"workspaceId": "[parameters('workspaceId')]",
"storageAccountId": "[parameters('storageAccountId')]",
"eventHubAuthorizationRuleId": "[parameters('eventHubAuthorizationRuleId')]",
"eventHubName": "[parameters('eventHubName')]",
"logs": [
{
"category": "Administrative",
"enabled": true
},
{
"category": "Security",
"enabled": true
},
{
"category": "ServiceHealth",
"enabled": true
},
{
"category": "Alert",
"enabled": true
},
{
"category": "Recommendation",
"enabled": true
},
{
"category": "Policy",
"enabled": true
},
{
"category": "Autoscale",
"enabled": true
},
{
"category": "ResourceHealth",
"enabled": true
}
]
}
}
]
}
You should have a Parameter file if you follow the above template.
Also note that when virtual networks are enabled Diagnostic Settings can't access Event Hubs resources. You have to enable the Allow trusted Microsoft services to bypass this firewall setting in Event Hub, so that Diagnostic Settings (Azure Monitor Services) is granted access to your Event Hubs resources.

Documents in Composite Template error in tabs

I add 2 composite templates to the envelope,
one of the composites has 2 recipients and 1 document,
the other composite has 1 recipient and 1 document,
however the signature tabs are only shown in the first document.
as shown in the image, the signature tabs are only on the first document
[enter image description here][1]
The Json:
"compositeTemplates": [
{
"document": {
"documentBase64": "xxxx",
"name:": "xxxx",
"documentId":"xxx"
},
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"deliveryMethod": "Email",
"email": "joao#protonmail.com",
"idCheckConfigurationName": "SMS Auth $",
"name": "joao da Silva",
"recipientId": "8c5fcdce-fe94-4379-8df7-608e753db718",
"requireIdLookup": "true",
"roleName": "Assinante",
"routingOrder": "1",
"smsAuthentication": {
"senderProvidedNumbers": [
"+5546994528888"
]
},
"status": "Created",
"tabs": {
"signHereTabs": [
{
"documentId": "1878974182",
"recipientId": "8c5fcdce-fe94-4379-8df7-608e753db718"
}
]
}
},
{
"deliveryMethod": "Email",
"email": "joana#gmail.com",
"idCheckConfigurationName": "SMS Auth $",
"name": "Joana Silva",
"recipientId": "11f6f9fc-c622-4d9b-9a98-4401a59cefbe",
"requireIdLookup": "true",
"roleName": "Testemunha",
"routingOrder": "2",
"smsAuthentication": {
"senderProvidedNumbers": [
"+5546994528888"
]
},
"status": "Created",
"tabs": {
"signHereTabs": [
{
"documentId": "1878974182",
"recipientId": "11f6f9fc-c622-4d9b-9a98-4401a59cefbe"
}
]
}
}
]
},
"sequence": "2"
}
],
"serverTemplates": [
{
"sequence": "1",
"templateId": "9b13a1dc-456c-4dff-87d8-ae4205dfb4eb"
}
]
},
{
"document": {
"documentBase64": "xxxx",
"name:": "xxxx",
"documentId":"xxx"
},
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"deliveryMethod": "Email",
"email": "pedro#outlook.com",
"idCheckConfigurationName": "SMS Auth $",
"name": "Pedro Silva",
"recipientId": "edd53f74-3e87-4380-859a-6d1fee7c5c92",
"requireIdLookup": "true",
"roleName": "Assinante",
"routingOrder": "1",
"smsAuthentication": {
"senderProvidedNumbers": [
"+5546994528888"
]
},
"status": "Created",
"tabs": {
"signHereTabs": [
{
"documentId": "1238654318",
"recipientId": "edd53f74-3e87-4380-859a-6d1fee7c5c92"
}
]
}
}
]
},
"sequence": "3"
}
],
"serverTemplates": [
{
"sequence": "2",
"templateId": "33b13eb1-25d5-46ee-b322-af433665b369"
}
]
}
]
}``
[1]: https://i.stack.imgur.com/HxbX3.jpg
The SignHereTab elements you specified won't show because they are missing something to determine their location. You can either use X/Y coordinates, or you can use anchor strings, but without any information, DocuSign won't know where to place them.
The tags you do see on the first document probably come from the template itself. Note if you meant for all tags to come from the template itself then you have to check the roleName and make sure it matches the role you defined in the template (For which you placed tags for).

Message card rendering issue in bot framework v3

I have a message card payload pushed from service now which is not rendering properly on MS Teams through bot framework. It only displays the content but not the button.Below is the payload, pls suggest what could be the issue.
BotFramework:V3
.Net SDK
Bot Builder package:3.12.2.4
Bot Connector:3.12.2.4
Bot.Connector.Teams:0.9.0
{
"contentType": "application/vnd.microsoft.teams.card.o365connector",
"content": {
"#type": "MessageCard",
"#context": "http://schema.org/extensions",
"title": "Incident Updated - INC0010010",
"summary": "Incident Updated - INC0010010",
"themeColor": "D1222B",
"sections": [
{
"title": "",
"text": "",
"activityTitle": "",
"activitySubtitle": "",
"activityText": "",
"facts": [
{
"name": "Category",
"value": "Software"
},
{
"name": "State",
"value": "New"
},
{
"name": "Priority",
"value": "5 - Planning"
},
{
"name": "Assignment group",
"value": "Software"
}
]
},
{
"text": "Please check the details"
}
],
"potentialAction": [
{
"#type": "OpenUri",
"name": "View Incident in ServiceNow",
"targets": [
{
"os": "default",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "iOS",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "android",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "windows",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=7ec9865adb711010fcff8809489619b4&sysparm_stack=incident_list.do?sysparm_query=active=true"
}
]
}
]
}
}
Microsoft Troubleshooting and recommendation:
We were finally able to repro this issue. It is a bug in the team's scope and doesn't repro in the personal scope. An easy way to unblock you would be to add in the potentialAction section an #id field like so:
"potentialAction": [
{
"#id":"1",
"#type": "OpenUri",
Nothing stands out as a bug in your code or problem with your configuration. Linking to the GitHub issue where it is being investigated/troubleshot:
https://github.com/microsoft/BotBuilder-V3/issues/208

How to capture action of hyperlinks of adaptive card in c#

I want to capture of action performed on hyperlink on Microsoft bot adaptive card. Using selection action I can capture the action but it's applicable for whole sentence. However, I want it to capture if it's clicked on link only. Below is my JSON template.
{
"type": "AdaptiveCard",
"body": [{
"type": "Container",
"items": [{
"type": "ColumnSet",
"columns": [{
"type": "Column",
"items": [{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "Test header",
"wrap": true
}],
"width": "stretch"
}]
},
{
"type": "ColumnSet",
"columns": [{
"type": "Column",
"items": [{
"type": "TextBlock",
"weight": "Bolder",
"text": "- first test [link](https://www.youtube.com/watch?v=dQw4w9WgXcQ)",
"wrap": true
}],
"width": "stretch",
"selectAction": {
"type": "Action.OpenUrl",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}
}]
},
{
"type": "ColumnSet",
"columns": [{
"type": "Column",
"items": [{
"type": "TextBlock",
"weight": "Bolder",
"text": "- second test [link](https://www.youtube.com/watch?v=dQw4w9WgXcQ)",
"wrap": true
}],
"width": "stretch"
}]
},
{
"type": "ColumnSet",
"columns": [{
"type": "Column",
"items": [{
"type": "TextBlock",
"weight": "Bolder",
"text": "- third test [link](https://www.youtube.com/watch?v=dQw4w9WgXcQ)",
"wrap": true
}],
"width": "stretch"
}]
}
]
}],
"backgroundImage": {
"url": "#",
"fillMode": "RepeatVertically"
},
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"id": "test"
}
Can you please guide me how can I achieve it?

Create DropDown list for jira custom field in REST API

I'm trying to retrieve the available options for fields through the Jira REST API but I'm getting stuck on the custom fields.
A normal field returns something like this:
{[priority, {
"required": false,
"schema": {
"type": "priority",
"system": "priority"
},
"name": "Priority",
"key": "priority",
"hasDefaultValue": true,
"operations": [
"set"
],
"allowedValues": [
{
"self": "https://inn-inw.atlassian.net/rest/api/2/priority/1",
"iconUrl": "https://inn-inw.atlassian.net/images/icons/priorities/highest.svg",
"name": "Highest",
"id": "1"
},
{
"self": "https://inn-inw.atlassian.net/rest/api/2/priority/2",
"iconUrl": "https://inn-inw.atlassian.net/images/icons/priorities/high.svg",
"name": "High",
"id": "2"
},
{
"self": "https://inn-inw.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://inn-inw.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
},
{
"self": "https://inn-inw.atlassian.net/rest/api/2/priority/4",
"iconUrl": "https://inn-inw.atlassian.net/images/icons/priorities/low.svg",
"name": "Low",
"id": "4"
},
{
"self": "https://inn-inw.atlassian.net/rest/api/2/priority/5",
"iconUrl": "https://inn-inw.atlassian.net/images/icons/priorities/lowest.svg",
"name": "Lowest",
"id": "5"
}
],
"defaultValue": {
"self": "https://inn-inw.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://inn-inw.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
}
}]}
The custom fields on the other hand return a much "smaller" set!
"Sprint" Custom Field:
{[customfield_10113, {
"required": false,
"schema": {
"type": "array",
"items": "string",
"custom": "com.pyxis.greenhopper.jira:gh-sprint",
"customId": 10113
},
"name": "Sprint",
"key": "customfield_10113",
"hasDefaultValue": false,
"operations": [
"set"
]
}]}
"Epic Link"
{[customfield_10006, {
"required": false,
"schema": {
"type": "any",
"custom": "com.pyxis.greenhopper.jira:gh-epic-link",
"customId": 10006
},
"name": "Epic Link",
"key": "customfield_10006",
"hasDefaultValue": false,
"operations": [
"set"
]
}]}
As you can see there are no options available, but i know that there are.
How can I get to these values through rest?
I have tried checking the request that the cloud server makes but it's pretty different for each of the custom fields and i cannot find a relation between them. For example:
To get the sprint possible values: https://inn-inw.atlassian.net/rest/greenhopper/1.0/sprint/picker?query=
and to get the Epic values: https://inn-inw.atlassian.net/rest/greenhopper/1.0/epics
I'm trying to make things as clean as possible and I would prefer not to hard code the request, specially because i would probably need to update the code every time a new custom field is created.
PS: I have tried some of the solutions presented in other questions but couldn't find one that fits what i need. eg: https://inn-inw.atlassian.net//rest/api/2/issue/createmeta?projectKeys=PROJKEY&issuetypeNames=Bug&expand=projects.issuetypes.fields returns only the short description that is displayed above.

Categories

Resources