【发布时间】:2022-08-03 15:43:52
【问题描述】:
我有一个 azure 函数,每次成功部署新版本时都会发送 Teams 消息。它显示了所有交付的工作项:错误和故事。直到几个月前,我在消息中的图标还显示颜色。它已停止这样做,它只显示黑色。图像的 url 仍然显示正确的图像和颜色,因此没有任何问题。
Teams 渲染器是否发生了一些变化,或者我是否需要调整我的自适应卡片模板?
以下是我的模板:
{
\"type\": \"message\",
\"attachments\": [
{
\"contentType\": \"application/vnd.microsoft.card.adaptive\",
\"contentUrl\": null,
\"content\": {
\"type\": \"AdaptiveCard\",
\"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",
\"version\": \"1.3\",
\"msteams\": {
\"width\": \"Full\"
},
\"body\": [
{
\"type\": \"ColumnSet\",
\"columns\": [
{
\"type\": \"Column\",
\"items\": [
{
\"size\": \"Large\",
\"type\": \"TextBlock\",
\"text\": \"${ReleaseTitle}\",
\"weight\": \"Bolder\"
}
],
\"width\": \"stretch\"
}
]
},
{
\"type\": \"ColumnSet\",
\"columns\": [
{
\"type\": \"Column\",
\"width\": \"auto\",
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"[Go to query](${QueryUrl})\",
\"isSubtle\": true,
\"height\": \"stretch\"
}
]
},
{
\"$when\": \"${ShowAdditionalQuery == true}\",
\"type\": \"Column\",
\"width\": \"auto\",
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"[additional query](${AdditionalQueryUrl})\",
\"isSubtle\": true,
\"height\": \"stretch\"
}
]
}
]
},
{
\"separator\": true,
\"text\": \"\",
\"type\": \"TextBlock\"
},
{
\"$when\": \"${$root.UserStories.Count > 0}\",
\"type\": \"ColumnSet\",
\"columns\": [
{
\"type\": \"Column\",
\"items\": [
{
\"type\": \"Image\",
\"url\": \"https://tfsprodweusu4.visualstudio.com/_apis/wit/workItemIcons/icon_book?v=2&color=0098C7\",
\"width\": \"20px\"
}
],
\"width\": \"auto\"
},
{
\"type\": \"Column\",
\"width\": \"stretch\",
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"User Stories\",
\"weight\": \"Bolder\"
}
]
}
]
},
{
\"$when\": \"${$root.UserStories.Count > 0}\",
\"type\": \"ColumnSet\",
\"columns\": [
{
\"type\": \"Column\",
\"width\": 4,
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"[${WorkItemId} - ${Title}](${Url})\",
\"isSubtle\": true
}
]
},
{
\"type\": \"Column\",
\"width\": 1,
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"${State}\",
\"isSubtle\": true
}
]
}
],
\"$data\": \"${$root.UserStories}\"
},
{
\"$when\": \"${$root.Bugs.Count > 0}\",
\"type\": \"ColumnSet\",
\"columns\": [
{
\"type\": \"Column\",
\"items\": [
{
\"type\": \"Image\",
\"url\": \"https://tfsprodweusu4.visualstudio.com/_apis/wit/workItemIcons/icon_insect?v=2&color=CC293D\",
\"width\": \"20px\"
}
],
\"width\": \"auto\"
},
{
\"type\": \"Column\",
\"width\": \"stretch\",
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"Bugfixes\",
\"weight\": \"Bolder\"
}
]
}
]
},
{
\"$when\": \"${$root.Bugs.Count > 0}\",
\"type\": \"ColumnSet\",
\"columns\": [
{
\"type\": \"Column\",
\"width\": 4,
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"[${WorkItemId} - ${Title}](${Url})\",
\"isSubtle\": true
}
]
},
{
\"type\": \"Column\",
\"width\": 1,
\"items\": [
{
\"type\": \"TextBlock\",
\"text\": \"${State}\",
\"isSubtle\": true
}
]
}
],
\"$data\": \"${$root.Bugs}\"
}
]
}
}
]
}
任何帮助将不胜感激
-
您能否分享图标(图片)的公共网址。这样我们就可以在最后本地检查它。
-
我们能够重现这个问题。我们为此提出了一个错误。如果有任何更新,我们会通知您。
-
关于这个@Meghana-MSFT 的任何消息?
-
由于后端代码中有关允许的 SVG 格式的限制,工程团队已指示使用以下 URL,tfsprodweusu4.visualstudio.com/_apis/wit/workItemIcons/… 团队还将进行后端更改以适应任一格式,因此不限于此格式。
标签: svg microsoft-teams adaptive-cards