kar*_*hik 5 microsoft-teams adaptive-cards microsoft-graph-api
问题:在自适应卡中,有一个下拉元素 (input.choiceset),其中包含我们的应用程序技术人员列表(属于我们应用程序的用户)。该列表将用于将票证分配给其中一名技术人员。当我们使用组件时,它在个人范围内可以正常工作,但在团队频道中显示时却无法按预期工作。
注意:我们正在为团队频道和个人聊天范围的消息传递扩展调用发送相同的自适应卡响应。
我已附上我们尝试过的示例卡 JSON 有效负载。
示例有效负载:
{
"content": {
"type": "AdaptiveCard",
"body": [
{
"items": [
{
"color": "attention",
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": "large",
"text": "#1884 without",
"weight": "bolder",
"wrap": true,
"spacing": "Default",
"separator": false,
"type": "TextBlock"
}
],
"separator": false,
"type": "Container"
},
{
"columns": [
{
"width": "auto",
"items": [
{
"horizontalAlignment": "right",
"size": "small",
"style": "person",
"url": "https://as-prod.asyncgw.teams.microsoft.com/urlp/v1/url/content?url=https%3a%2f%2fcontacts.localzoho.com%2ffile%3fexp%3d10%26ID%3d-1%26t%3duser%26height%3d60%26width%3d60",
"width": "35px",
"height": "35px",
"separator": false,
"type": "Image"
}
],
"separator": false,
"type": "Column"
},
{
"width": "stretch",
"items": [
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": null,
"text": "Aa Guru Req",
"weight": "bolder",
"wrap": true,
"spacing": "Default",
"separator": false,
"type": "TextBlock"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": true,
"maxLines": 0,
"size": "small",
"text": "Mar 24, 2023 06:50 PM",
"weight": "lighter",
"wrap": true,
"spacing": "None",
"separator": false,
"type": "TextBlock"
}
],
"separator": false,
"type": "Column"
}
],
"separator": true,
"type": "ColumnSet"
},
{
"items": [
{
"facts": [
{
"title": "Status",
"value": "Open"
},
{
"title": "Technician",
"value": "Not Assigned"
},
{
"title": "Priority",
"value": "Not Assigned"
}
],
"spacing": "Medium",
"separator": true,
"type": "FactSet"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": null,
"text": "You can view in [ServiceDesk Plus Cloud](https://sdpondemand.localmanageengine.com/app/itdesk/ui/requests/4213000001845143/details)",
"weight": null,
"wrap": true,
"spacing": "Medium",
"separator": false,
"type": "TextBlock"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": null,
"text": " ",
"weight": null,
"wrap": true,
"spacing": "Medium",
"separator": false,
"type": "TextBlock"
}
],
"separator": false,
"type": "Container"
}
],
"actions": [
{
"card": {
"type": "AdaptiveCard",
"body": [
{
"isMultiline": true,
"maxLength": 0,
"placeholder": "Add Notes",
"style": null,
"value": "",
"isRequired": false,
"id": "addnote",
"separator": false,
"type": "Input.Text"
}
],
"actions": [
{
"data": {
"mode": "add notes",
"msteams": {
"text": "cardAction add notes",
"type": "messageBack"
},
"requestId": "4213000001845143",
"portalId": "63097041",
"displayId": "1884"
},
"title": "Save",
"type": "Action.Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
},
"title": "Add Notes",
"type": "Action.ShowCard"
},
{
"data": {
"mode": "pickup",
"msteams": {
"text": "cardAction pickup",
"type": "messageBack"
},
"requestId": "4213000001845143",
"portalId": "63097041",
"displayId": "1884"
},
"title": "Pick up",
"type": "Action.Submit"
},
{
"card": {
"type": "AdaptiveCard",
"body": [
{
"choices": [
{
"title": "Chennai",
"value": "4213000000207015"
},
{
"title": "qamailtest",
"value": "4213000000650033"
},
{
"title": "Santhosh",
"value": "4213000001226072"
}
],
"isMultiSelect": false,
"style": null,
"placeholder": "Assign To",
"isRequired": false,
"id": "assignTO",
"separator": false,
"type": "Input.ChoiceSet"
}
],
"actions": [
{
"data": {
"mode": "assign to",
"msteams": {
"text": "cardAction assign to",
"type": "messageBack"
},
"requestId": "4213000001845143",
"portalId": "63097041",
"displayId": "1884"
},
"title": "Assign",
"type": "Action.Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
},
"title": "Assign To",
"type": "Action.ShowCard"
},
{
"data": {
"mode": "close",
"msteams": {
"text": "cardAction close",
"type": "messageBack"
},
"requestId": "4213000001845143",
"portalId": "63097041",
"displayId": "1884"
},
"title": "close",
"type": "Action.Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
},
"contentType": "application/vnd.microsoft.card.adaptive",
"preview": {
"content": {
"title": "#1884 without",
"text": "Open | Not Assigned | Mar 24, 2023 06:50 PM"
},
"contentType": "application/vnd.microsoft.card.thumbnail"
}
}
Run Code Online (Sandbox Code Playgroud)
附上截图供您参考:
| 归档时间: |
|
| 查看次数: |
115 次 |
| 最近记录: |