Was able to setup a working flow as follows
- When a Teams webhook request is received
- Parse JSON (or import the sample gitlab json)
{ "type": "object", "properties": { "sections": { "type": "array", "items": { "type": "object", "properties": { "activityTitle": { "type": "string" }, "activitySubtitle": { "type": "string" }, "activityText": { "type": "string" }, "activityImage": { "type": "string" }, "text": { "type": "string" } }, "required": [] } }, "title": { "type": "string" }, "summary": { "type": "string" } } }
- Initialize variable commits
- For loop and Set variable concat text into commits
concat(item()?['text'], '\n\n')
- Configure Post card in a chat or channel with target channel/group and AdaptiveCard
{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.2", "body": [ { "type": "Container", "items": [ { "type": "TextBlock", "size": "Medium", "weight": "Bolder", "text": "GitLab Update - @{body('Parse_JSON')?['title']}" }, { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "Image", "url": "@{first(body('Parse_JSON')?['sections'])['activityImage']}", "size": "Small", "style": "Person" } ], "width": "auto" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "@{first(body('Parse_JSON')?['sections'])['activityTitle']}", "wrap": true, "weight": "Bolder" }, { "type": "TextBlock", "text": "@{first(body('Parse_JSON')?['sections'])['activitySubTitle']}", "isSubtle": true, "wrap": true } ], "width": "stretch" } ] }, { "type": "TextBlock", "text": "@{first(body('Parse_JSON')?['sections'])['activityText']}", "wrap": true }, { "type": "TextBlock", "text": "@{variables('commits')}", "wrap": true } ] } ] }