How to setup Teams Workflows for Jira Data Center to receive updates on the tickets

Teams Workflows provides a seamless way to automate tasks, integrate with various services, and improve team collaboration. This guide will help you navigate the process, ensuring a smooth transition from Connectors to Workflows, and leverage the full potential of the latest features and functionalities that Teams Workflows offer.

  1. Go to Teams

  2. Right-click on any channel

  3. Select ‘Workflows'image-20240718-135205.png

  4. Click on ‘More workflows’image-20240718-135300.png
  5. Create from blank image-20240718-135504.png

Now we need to create a flow chain that will listen to Jira webhooks and react to the JSON sent in the request. In this example, we will send an Adaptive card with information about the changed issue to the channel

  1. Add 'When a Teams webhook request is received' triggerimage-20240718-135720.png
  2. Select “Anyone” for “Who can trigger the flow?“
  3. Webhook will be automatically generated after workflow saving. We need to copy and paste it to the Jira DC Webhooksimage-20240718-135828.png
  4. Go to your Jira DC Instance → :settings: → System → WebHooks → :plus: Create new Webhook
  5. Paste the HTTP POST URL from Teams to the URL field and select Events

HTTP POST URL should be decoded or all ‘%2F' should be replaced with the '/’, otherwise Jira Webhook will throw 403 error code

The domain for the webhook should be added to the Allow list in order to send data to the webhook. otherwise, it could be blocked.

image-20240718-140200.png

     5. Add new action to the Workflow → Prase JSON

image-20240718-140247.png

     6. Set @{triggerBody()} to the Content field

     7. Set Json Schema to the Schema field

{
    "type": "object",
    "properties": {
        "webhookEvent": {
            "type": "string"
        },
        "issue_event_type_name": {
            "type": "string"
        },
        "user": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "avatarUrls": {
                    "type": "object",
                    "properties": {
                        "48x48": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                }
            }
        },
        "issue": {
            "type": "object",
            "properties": {
                "self": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "fields": {
                    "type": "object",
                    "properties": {
                        "issuetype": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                }
                            }
                        },
                        "summary": {
                            "type": "string"
                        },
                        "description": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "status": {
                            "type": "object",
                            "properties": {
                                "statusCategory": {
                                    "type": "object",
                                    "properties": {
                                        "name": {
                                            "type": "string"
                                        },
                                        "colorName": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        },
                        "priority": {
                            "type": "object",
                            "properties": {
                                "iconUrl": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        },
                        "assignee": {
                            "type": [
                                "object",
                                "null"
                            ],
                            "properties": {
                                "avatarUrls": {
                                    "type": "object",
                                    "properties": {
                                        "48x48": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "changelog": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "field": {
                                "type": "string"
                            },
                            "fromString": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "toString": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    }
                }
            }
        }
    }
}

     8. Add new Action → Post card in a chat or channel

image (1).png

     9. Choose where the Adaptive card will be sent and configure the Adaptive Card JSON

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.4",
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "Container",
            "width": "stretch",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "Image",
                                    "style": "Person",
                                    "url": "@{if(equals(body('Parse_JSON')?['user']?['avatarUrls']?['48x48'], null), 'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp&f=y', body('Parse_JSON')['user']['avatarUrls']['48x48'])}",
                                    "size": "Small",
                                    "height": "32px",
                                    "width": "32px",
                                    "horizontalAlignment": "Right"
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "@{if(equals(body('Parse_JSON')['webhookEvent'], 'jira:issue_created'), concat(body('Parse_JSON')['user']['name'], ' **created** this issue:'), if(equals(body('Parse_JSON')['issue_event_type_name'], 'issue_commented'), concat(body('Parse_JSON')['user']['name'], ' **commented** on this issue:'), concat(body('Parse_JSON')['user']['name'], ' updated the **', body('Parse_JSON')['changelog']['items'][0]['field'], '** on this issue:')))}",
                                    "size": "Large",
                                    "color": "Default",
                                    "wrap": true
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "@{concat('https://product-integrations-cdn.atl-paas.net/jira-issuetype/medium/', if(or(equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'access request'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'bug'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'epic'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'change'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'concern'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'defect'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'design task'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'development task'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'documentation'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'improvement'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'incident'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'issue'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'new feature'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'new-feature'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'problem'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'question'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'remove feature'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'requirement'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'sales request'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'story'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'sub-task'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'subtask'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'suggestion'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'task')), toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'bug grey'), '.png')}",
                                    "size": "Small",
                                    "width": "24px",
                                    "horizontalAlignment": "Right"
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": 80,
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "@{concat(body('Parse_JSON')['issue']['key'], ' - ', replace(body('Parse_JSON')['issue']['fields']['summary'], '"', '\"'))
}",
                                    "color": "Default",
                                    "wrap": true
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": 20,
                            "items": [
                                {
                                    "type": "RichTextBlock",
                                    "inlines": [
                                        {
                                            "type": "TextRun",
                                            "text": "@{toUpper(body('Parse_JSON')['issue']['fields']['status']['statusCategory']['name'])}",
                                            "highlight": true,
                                            "isSubtle": true,
                                            "color": "Default"
                                        }
                                    ]
                                }
                            ],
                            "verticalContentAlignment": "Center",
                            "rtl": true
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "@{if(equals(body('Parse_JSON')['issue']['fields']['assignee'], null), 'https://jira.atlassian.com/secure/useravatar?size=small&avatarId=10613', body('Parse_JSON')['issue']['fields']['assignee']['avatarUrls']['48x48'])}",
                                    "size": "Small",
                                    "width": "24px",
                                    "style": "Person",
                                    "horizontalAlignment": "Right"
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        }
                    ],
                    "separator": true,
                    "spacing": "ExtraLarge"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "Small",
                    "isVisible": "@{and(not(equals(body('Parse_JSON')['webhookEvent'], 'jira:issue_created')), contains(string(body('Parse_JSON')), 'changelog'))}",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "RichTextBlock",
                                    "horizontalAlignment": "Right",
                                    "inlines": [
                                        {
                                            "type": "TextRun",
                                            "text": "@{if(or(equals(body('Parse_JSON')?['changelog']?['items']?[0]?['fromString'], null), equals(body('Parse_JSON')?['changelog']?['items']?[0]?['fromString'], '')), 'Empty', replace(body('Parse_JSON')?['changelog']?['items']?[0]?['fromString'], '"', '\"'))
}"
                                        }
                                    ]
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "verticalContentAlignment": "Center",
                            "width": "15px",
                            "items": [
                                {
                                    "type": "RichTextBlock",
                                    "inlines": [
                                        {
                                            "type": "TextRun",
                                            "text": "→"
                                        }
                                    ]
                                }
                            ],
                            "spacing": "Small"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "RichTextBlock",
                                    "inlines": [
                                        {
                                            "type": "TextRun",
                                            "text": "@{if(or(equals(body('Parse_JSON')?['changelog']?['items']?[0]?['toString'], null), equals(body('Parse_JSON')?['changelog']?['items']?[0]?['toString'], '')), 'Empty', replace(body('Parse_JSON')?['changelog']?['items']?[0]?['toString'], '"', '\"'))
}"
                                        }
                                    ]
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "spacing": "Small",
                    "isVisible": "@{contains(body('Parse_JSON')['issue_event_type_name'], 'issue_commented')}",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "@{if(equals(body('Parse_JSON')['issue_event_type_name'], 'issue_commented'), replace(body('Parse_JSON')?['comment']?['body'], '"', '\"'), '')
}",
                                    "wrap": true
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        }
                    ]
                },
                {
                    "type": "ActionSet",
                    "actions": [
                        {
                            "type": "Action.OpenUrl",
                            "title": "Open in Jira",
                            "url": "@{concat(substring(body('Parse_JSON')['issue']['self'], 0, indexOf(body('Parse_JSON')['issue']['self'], '/rest/api/2/issue')), '/browse/', body('Parse_JSON')['issue']['key'])}"
                        }
                    ]
                }
            ]
        }
    ],
    "msTeams": {
        "width": "full"
    }
}

     10. The final step chain should look like on the screenshot

image-20240725-093250.png

Now when the issue in Jira Data Center is modified, the Adaptive card will be sent to the chosen channel

image-20240725-094326 (1).pngimage-20240725-094308.pngimage-20240725-094245.png


____________________________________________________________________________

Advanced configuration

The configuration above  works only for issue created and updated events, including comment creation event. If you also want to receive the events when comment was updated or removed or just events related to comments, please follow next instructions to adjust the Workflow configuration above:

  1. Update Webhook configuration to include comment related events
    Screenshot 2024-09-26 at 16.09.17.png
  2. Update schema for Parse JSON action (Step #5) to the latest version provided above
  3. Add Condition action (Add an action → Control: Condition) after Parse JSON action with next configuration:
    1. "@body('Parse_JSON')?['webhookEvent']" equals "jira:issue_created"

    2.  OR
      1. "@body('Parse_JSON')?['webhookEvent']" equals "jira:issue_updated"
      2. AND "@body('Parse_JSON')?['issue_event_type_name']" not contains "comment"
        Screenshot 2024-09-26 at 16.13.29.png
    3. Additionally you can open the workflow in https://make.powerautomate.com/ and add the condition as a code in the Code View:
       "expression": {
          "or": [
            {
              "equals": [
                "@body('Parse_JSON')?['webhookEvent']",
                "jira:issue_created"
              ]
            },
            {
              "and": [
                {
                  "equals": [
                    "@body('Parse_JSON')?['webhookEvent']",
                    "jira:issue_updated"
                  ]
                },
                {
                  "not": {
                    "contains": [
                      "@body('Parse_JSON')?['issue_event_type_name']",
                      "comment"
                    ]
                  }
                }
              ]
            }
          ]
        }

      Screenshot 2024-09-26 at 16.20.50.png
  4. Drag and drop the Teams card created in step #8 above to the True/If yes condition
    Screenshot 2024-09-26 at 16.23.02.png
  5. Under No/If no condition add one more action condition with next configuration:
    1. "@body('Parse_JSON')?['webhookEvent']" equals "comment_created"
    2. OR "@body('Parse_JSON')?['webhookEvent']" equals "comment_updated"
    3. OR "@body('Parse_JSON')?['webhookEvent']" equals "comment_deleted"
      Screenshot 2024-09-26 at 16.24.41.png

    4. Or you can use code view with the same configuration
        "expression": {
          "or": [
            {
              "equals": [
                "@body('Parse_JSON')?['webhookEvent']",
                "comment_created"
              ]
            },
            {
              "equals": [
                "@body('Parse_JSON')?['webhookEvent']",
                "comment_updated"
              ]
            },
            {
              "equals": [
                "@body('Parse_JSON')?['webhookEvent']",
                "comment_deleted"
              ]
            }
          ]
        }
  6. You should receive next structure:
    Screenshot 2024-09-26 at 16.30.36.png
  7. Under True/If Yes condition add new Action → Post card in a chat or channel with next content:
    {
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.4",
        "type": "AdaptiveCard",
        "body": [
            {
                "type": "Container",
                "width": "stretch",
                "items": [
                    {
                        "type": "ColumnSet",
                        "columns": [
                            {
                                "type": "Column",
                                "width": "auto",
                                "items": [
                                    {
                                        "type": "Image",
                                        "style": "Person",
                                        "url": "@{if(equals(body('Parse_JSON')?['comment']?['author']?['avatarUrls']?['48x48'], null), 'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp&f=y', body('Parse_JSON')['comment']['author']['avatarUrls']['48x48'])}",
                                        "size": "Small",
                                        "height": "32px",
                                        "width": "32px",
                                        "horizontalAlignment": "Right"
                                    }
                                ],
                                "verticalContentAlignment": "Center"
                            },
                            {
                                "type": "Column",
                                "width": "stretch",
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "text": "@{if(equals(body('Parse_JSON')['webhookEvent'], 'comment_updated'), concat(body('Parse_JSON')['comment']['author']['name'], ' **updated comment** on this issue::'), if(equals(body('Parse_JSON')['webhookEvent'], 'comment_deleted'), concat(body('Parse_JSON')['comment']['author']['name'], ' **removed commented** on this issue:'), concat(body('Parse_JSON')['comment']['author']['name'], ' **commented** on this issue:')))}",
                                        "size": "Large",
                                        "color": "Default",
                                        "wrap": true
                                    }
                                ],
                                "verticalContentAlignment": "Center"
                            }
                        ]
                    },
                    {
                        "type": "ColumnSet",
                        "columns": [
                            {
                                "type": "Column",
                                "width": "auto",
                                "items": [
                                    {
                                        "type": "Image",
                                        "url": "@{concat('https://product-integrations-cdn.atl-paas.net/jira-issuetype/medium/', if(or(equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'access request'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'bug'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'epic'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'change'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'concern'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'defect'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'design task'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'development task'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'documentation'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'improvement'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'incident'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'issue'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'new feature'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'new-feature'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'problem'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'question'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'remove feature'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'requirement'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'sales request'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'story'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'sub-task'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'subtask'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'suggestion'), equals(toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'task')), toLower(body('Parse_JSON')['issue']['fields']['issuetype']['name']), 'bug grey'), '.png')}",
                                        "size": "Small",
                                        "width": "24px",
                                        "horizontalAlignment": "Right"
                                    }
                                ],
                                "verticalContentAlignment": "Center"
                            },
                            {
                                "type": "Column",
                                "width": 80,
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "text": "@{concat(body('Parse_JSON')['issue']['key'], ' - ', replace(body('Parse_JSON')['issue']['fields']['summary'], '"', '\"'))
    }",
                                        "color": "Default",
                                        "wrap": true
                                    }
                                ],
                                "verticalContentAlignment": "Center"
                            },
                            {
                                "type": "Column",
                                "width": 20,
                                "items": [
                                    {
                                        "type": "RichTextBlock",
                                        "inlines": [
                                            {
                                                "type": "TextRun",
                                                "text": "@{toUpper(body('Parse_JSON')['issue']['fields']['status']['statusCategory']['name'])}",
                                                "highlight": true,
                                                "isSubtle": true,
                                                "color": "Default"
                                            }
                                        ]
                                    }
                                ],
                                "verticalContentAlignment": "Center",
                                "rtl": true
                            },
                            {
                                "type": "Column",
                                "width": "auto",
                                "items": [
                                    {
                                        "type": "Image",
                                        "url": "@{if(equals(body('Parse_JSON')['issue']['fields']['assignee'], null), 'https://jira.atlassian.com/secure/useravatar?size=small&avatarId=10613', body('Parse_JSON')['issue']['fields']['assignee']['avatarUrls']['48x48'])}",
                                        "size": "Small",
                                        "width": "24px",
                                        "style": "Person",
                                        "horizontalAlignment": "Right"
                                    }
                                ],
                                "verticalContentAlignment": "Center"
                            }
                        ],
                        "separator": true,
                        "spacing": "ExtraLarge"
                    },
                    {
                        "type": "ColumnSet",
                        "spacing": "Small",
                        "columns": [
                            {
                                "type": "Column",
                                "width": "stretch",
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "text": "@{replace(body('Parse_JSON')?['comment']?['body'], '"', '\"')}",
                                        "wrap": true
                                    }
                                ],
                                "verticalContentAlignment": "Center"
                            }
                        ]
                    },
                    {
                        "type": "ActionSet",
                        "actions": [
                            {
                                "type": "Action.OpenUrl",
                                "title": "Open in Jira",
                                "url": "@{concat(substring(body('Parse_JSON')['issue']['self'], 0, indexOf(body('Parse_JSON')['issue']['self'], '/rest/api/2/issue')), '/browse/', body('Parse_JSON')['issue']['key'])}"
                            }
                        ]
                    }
                ]
            }
        ],
        "msTeams": {
            "width": "full"
        }
    }
  8. Save Workflow. In the end you should receive the structure (depending on editor you are using):
    Screenshot 2024-09-26 at 16.33.47.png

    Screenshot 2024-09-26 at 16.34.12.png

Cheers,
Product Integrations Team

65 comments

Roberto Ialino
Contributor
July 30, 2024

Hi Zakhar, thank you very much!  Just one question  I have a 400 on the "Post card" with the Adaptive Card JSON I suppose.

 

"body": {
        "error": {
            "code": "BadRequest",
            "message": "InvalidParameter",
            "innerError": {
                "code": "1",
                "message": "Invalid format of cards property",
                "date": "2024-07-30T12:43:55",
                "request-id": "6ebed303-5573-4d2c-8847-022607c87f25",
                "client-request-id": "6ebed303-5573-4d2c-8847-022607c87f25"
            }
        }
    }
Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2024

Hi @Roberto Ialino 

Could you please go to edit page of the workflow and try next steps?

Screenshot 2024-08-01 at 10.50.52.png
Screenshot 2024-08-01 at 10.51.25.png
Screenshot 2024-08-01 at 11.02.12.png

Check the output and share it here. It will give more details why card is not sent.

BR,
Volodymyr B.

Roberto Ialino
Contributor
August 7, 2024

Hi @Volodymyr Batrukh

sorry for my delayed answer and thank you very much for your support.

I reacreated everything as from the attached image.

What is different from you screenshots at poin 8 is the Adaptive Card JSON and is equal to your point 9 (these 2 points sorry, are not clear to me 100%)

Immagine 2024-08-07 143820.png

There is for sure some problem on the JSON 

Now I have Bad Request. This is the output.

{
  "error": {
    "code""BadRequest",
    "message""Failed to process content in attachment with Id '62d2dd593bd741baa688ffb7ded138ce'.",
    "innerError": {
      "date""2024-08-07T12:42:38",
      "request-id""18238259-27e6-4857-9032-47da41e3aa9b",
      "client-request-id""18238259-27e6-4857-9032-47da41e3aa9b"
    }
  }
}

Thanks a lot

Roberto

Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2024

Hi @Roberto Ialino 

The image on Step #8 was not accurate (we have updated it to much the card json from Step #9). Thanks for noticing it!

For the Post card in a chat or channel action use content from the Step #9 an set it as an Adaptive card for the action configuration.

As for your original error "message": "Invalid format of cards property"," please try to change Post as setting for Post card in a chat or channel action from the User to Flow bot.

Screenshot 2024-08-07 at 16.12.13.png

The option with a User seems to be broken (as there should be an option to select a user). We were able to reproduce an issue with User selected in Post as drop down.

Hope it will help you to resolve the issue.

BR,
Volodymyr B.

Roberto Ialino
Contributor
August 7, 2024

Hi @Volodymyr Batrukh 

you json at step 9 is on my Adaptive Card input starting from "type" : "Adaptive Card" since all the json at step 9 does not work. I mean with the schema etc...

With Flow bot does not work the save for this error

Flow save failed with code 'OpenApiOperationParameterValidationFailed' and message 'Input parameter 'body' validation failed in workflow operation 'Post_card_in_a_chat_or_channel': The API operation 'PostCardToConversation' is missing required property 'body/messageBody'.'.

Thank you very much.

Best regards,

Roberto

Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2024

Hi @Roberto Ialino 

The content for JSON Schema and Adaptive cards should be used as is, without any modifications. If you omit $schema or version or opening brackets from the Adaptive Card it will be invalid, so failure is expected.

In the end you should have something like:

Screenshot 2024-08-07 at 17.48.24.png
...

Screenshot 2024-08-07 at 17.48.51.png


I am not sure why the option with Flow Bot is not working for your configuration (BTW we have tried to use User option on another Teams tenant and it was working). Please try to completely  remove the step with card and add it from the scratch.

Regards,
Volodymyr B.

Roberto Ialino
Contributor
August 8, 2024

Hi @Volodymyr Batrukh I tried with the previous json version (on my previous comments) since with the full JSON provided on your initial post I have unfortunetelly an invalid parameter :(

Everything is as you showed but it doesn't work for me.

Thanks,

Roberto

 

  "error": {
    "code""BadRequest",
    "message""InvalidParameter",
    "innerError": {
      "code""1",
      "message""Invalid format of cards property",
      "date""2024-08-08T12:21:53",
      "request-id""fd99b3e5-8e48-4314-bb6e-131c7090d207",
      "client-request-id""fd99b3e5-8e48-4314-bb6e-131c7090d207"
    }
  }
}
flow.pngflow 2.png
Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2024

Hi @Roberto Ialino 

Thanks for providing more details.
Could you please share, if it is possible, the Adaptive Card output that was generated during the test or run (from the screenshot with error)? You can try to obfuscate/remove data from the text if it contains confidential information (i.e. user name/comment).

We suspect your Jira ticket can contain some specific data or special characters (i.e. some unicode characters from non US text) that cannot be parsed properly and it caused the failure. |


Additionally, you can try to send notification from some simple software development project in Jira (i.e. project having just summary, description without any specific custom fields).


Regards,
Volodymyr B.

Eric Sebian
Contributor
August 8, 2024

Unfortunately, I don't see the 'When a Teams webhook request is received' trigger. :(

is this something that my MS admin has to allow?

Eric Sebian
Contributor
August 8, 2024

scratch that. though I'm not able to save it without a trigger and one action. And that is not mentioned above. 

 

 

Eric Sebian
Contributor
August 8, 2024

Ignore me. Too much to read. 

Roberto Ialino
Contributor
August 9, 2024

hi @Volodymyr Batrukh YES ! with a standard jira software it works so is the JSON Adapive Card that i need to check for my projects and resolve.

The output body is waht i shared and what you can see on my previous attahcment.

{
  "error": {
    "code""BadRequest",
    "message""InvalidParameter",
    "innerError": {
      "code""1",
      "message""Invalid format of cards property",
      "date""2024-08-09T08:52:09",
      "request-id""38dbb922-6172-4f51-8a9f-de0004ccc748",
      "client-request-id""38dbb922-6172-4f51-8a9f-de0004ccc748"
    }
  }
}
Thanks a lot!
Roberto
Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 9, 2024

Hi @Roberto Ialino 

If the notifications works for simple projects it seems there is some data in Jira tickets that can break the card. I.e. some special characters in issue Summary, or in comment or in changed values. We were testing cards for such issues, but seems not all cases are covered.

To do the further investigation could you please send as the data you have received here (please substitute sensitive data before posting content here):

Screenshot 2024-08-09 at 15.52.15.png

Another option you can do, copy the content of the adaptive card (from the screenshot above) that is failing to https://adaptivecards.io/designer/

Screenshot 2024-08-09 at 15.59.43.png

if the adaptive card is invalid, it will not be displayed and also you will see the error in the content that is causing issue (highlighted in red in the Card Payload Editor). Please share this line with us.

Regards,
Volodymyr B.

Roberto Ialino
Contributor
August 9, 2024

Hi @Volodymyr Batrukh and finally we resolved !!!!!!!!!!!!!!!!!!!

The error is on your JSON of the Adaptive Card at point 9 (see image below)

There was the property color with "inprogress" inside.

I changed it with  "color": "Default"

Thanks a lot for your support.

Best regards,

Roberto

Immagine 2024-08-09 162245.png

Like Volodymyr Batrukh likes this
Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 9, 2024

@Roberto Ialino  glad to hear that issue was fixed for you. Yeah, there are few available colors we can use in adaptive cards and if mapping doesn't  fit it can break the card...

Thanks a lot for helping to identify the issue it will help other community members for sure. We will update the guide with up to date card schema.

Regards,
Volodymyr B.

Roberto Ialino
Contributor
August 9, 2024

Hi @Volodymyr Batrukh yes it could be useful for all. Thank you very much !

We also need to fix the fact that the arrival of the adaptive card on MS Teams does not play a sound (sound is on) and the notifications are not in the MS Teams activity list. I wll check on the next days.

Best regards,

Roberto

Eric Sebian
Contributor
August 12, 2024

I'm very new to the teams workflow. I set this up following the instructions but when I went to test, I get: 

Flow '1aab7615-3530-4f38-b836-d151a2b2db75' cannot be installed.

 

Can someone direct me as to how to proceed? 

thanks. 

Roberto Ialino
Contributor
August 12, 2024

Hi @Eric Sebian is too much generic this error. Please give more details o post a question on the power platform community https://community.powerplatform.com/

If you follow all the steps described by Zakhar should not happens unless you don't have a licence also free for power automate.

Best regards,

Roberto

Eric Sebian
Contributor
August 12, 2024

I need a license for power automate? 

Eric Sebian
Contributor
August 12, 2024

image.png

Eric Sebian
Contributor
August 12, 2024

this is what I have. But when I update a ticket in the comments, I get nothing. 

Eric Sebian
Contributor
August 12, 2024

Oh, and here is the web hook. 

Roberto Ialino
Contributor
August 13, 2024

Hi @Eric Sebian is a bit hard to help you. Try to create andother diffeent flow (an easy flow) and check if you have the same error first. If yes probably better write to https://community.powerplatform.com/.

Best regards,

Roberto

Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 14, 2024

Hi @Eric Sebian 

The webhook for the first step "When a Teams webhook request is received" is generated only after saving the workflow. So you may not find the webhook url right after adding the step.

Regards,
Volodymyr B.

Eric Sebian
Contributor
August 14, 2024

Gotcha. I figured that out, but it's still failing. Do I need MS power automate for this to work? MS Support is saying that I might.  

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events