Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

72 comments

원유준
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2024

Hello @Zakhar Listiev

This was an informative article.

Is there any way to set this up via Automation instead of webhooks?

You can set up a trigger like below, and then branch out to set it up per project.

image.png

Best regards,
Yujun Won


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

Hi @원유준 

Theoretically Jira automation can be used instead of Jira webhooks, but you will need to send the expected request with custom data (the format of the request data should look like one in the comment above)

Screenshot 2024-08-21 at 11.58.00.png

Regards,
Volodymyr B.

Eric Sebian
Contributor
August 21, 2024

Hi Volodymyr. 

I checked the statusCategory in a browser and the following returns:

 

{"self":"https://jira.jcrew.com/rest/api/2/status/14149","description":"","iconUrl":"https://jira.jcrew.com/","name":"Selected for Development","id":"14149","statusCategory":{"self":"https://jira.jcrew.com/rest/api/2/statuscategory/2","id":2,"key":"new","colorName":"default","name":"To Do"}}

 So it does show the correct status (Selected for Development) but the defaults to this at the end of the line: "colorName":"default","name":"To Do"}}. Thoughts? If you can help me fix this, I think it will be my last question! :)

 

At least until my next on. 

ejs

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

Hi @Eric Sebian 

Oh, I see...so you are using different names for Status and Status Category in your Jira Configuration. In that case you need to adjust the card data.
Please edit your workflow, open the last step and edit the schema for adaptive card - you need to change

toUpper(body('Parse_JSON')['issue']['fields']['status']['statusCategory']['name']) to
toUpper(body('Parse_JSON')['issue']['fields']['status']['name'])

Screenshot 2024-08-21 at 20.03.35.png

Regards,
Volodymyr B.
Eric Sebian
Contributor
August 25, 2024

Hi Volodomyr. 

 

Getting this error. See image. The only thing that I changed was the channel/team. image.png

Eric Sebian
Contributor
August 26, 2024

hi volodomyr.

any thought on the error i posted? Also, with the old connector recognized links. Is there anyway to make links active in this one?

Eric Sebian
Contributor
August 26, 2024

Here is the error from the last failed attempt:

See image.image.png

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

Hi @Eric Sebian 

The error on running the flow is related to the fact that Jira is sending two different events when comment is created and processing of one of them is failing. That is the same error we have discussed here - https://community.atlassian.com/t5/Jira-articles/How-to-setup-Teams-Workflows-for-Jira-Data-Center-to-receive/bc-p/2789448#M15462

> Also, with the old connector recognized links. Is there anyway to make links active in this one?

Eric, could you please add more details on this issue? not really sure what is "old connector" and what is "this one"...Do you mean if we can somehow reuse the webhooks from Jira Server connector (that is deprecated now) and use them in new flows?

Regards,
Volodymyr Batrukh

Eric Sebian
Contributor
August 27, 2024

Thanks, Volodymyr. 

I have reached out to Atlassian and am awaiting help. Didn't realize this was the same issue as it is not happening in my original workflow which is working the same with reference to the same jira project. 

 

As for the the reference to "old connector", I was speaking of the format of the deprecated connector's results vs. the new format. In the first image from the now deprecated connector, links added into jira comments were displayed in teams as rich text links. While in the 2nd image, the are not.  Not the end of the world, but the user was inquiring. Thanks. image.pngimage.png

Eric Sebian
Contributor
August 27, 2024

Also, I attempted the earlier changes that you mentioned, but still no good. image.png

Eric Sebian
Contributor
August 27, 2024

this error was displayed by copilot: image.png

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

Hi  @Eric Sebian 

The Jira markup will not be displayed on new Adaptive cards as they are using different rules, that is why formatted text from Jira event is displayed as is. Old cards (Office 365 cards) from Jira Server connector were using the same rules for displaying formatted text...So that is expected behavior

As for the error on your flow with conditions it seems that this channel and/or team are using different access rules. Have you tried to install Workflow app to that team directly (<Team> -> Manage Team -> Apps -> <Add Workflows app> OR find Workflows app and select Add to a team) ?

Regards,
Volodymyr B.

Eric Sebian
Contributor
August 29, 2024

Hi Volodymyr. 

Thanks for answering my question on the jira markup. Unfortunate, but I think that the users will be happy to have this rather than nothing. As of the error, I attempted to create the workflow directly from the teams channel itself with no luck. Though I think that I have figured out that the issue is related to the permissions of the actual teams channel. When I create a new channel, everything works as expected. With that said, I now have to determine how to modify the permissions of existing channels that want this configure again. 

 

One more question (I know I've said that before, but I think this time will be true!) Here it goes. Is there a way to change the font size for each of the pieces? See image. 

image.png

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

Hi @Eric Sebian 

Sorry I have missed your last message. In order to change the text size you need to edit corresponding TextBlock sizes:

Screenshot 2024-09-24 at 16.44.24.png

The values you can use:

  • "default"
  • "small"
  • "medium"
  • "large"
  • "extraLarge"
Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 24, 2024

Hi all,

It seems like Jira webhooks schema was changed a bit and avatar urls for user is not always received. If you have an error like below while trying to execute the workflow, please update the adaptive card schema by one mentioned in this article (updated card).

Screenshot 2024-09-24 at 16.50.46.png

Regards,
Volodymyr B.

Eric Sebian
Contributor
April 22, 2025

Hi Volodymyr- I have recently upgraded jira to version 10.3.5 and then the links stopped working. it was failing.  Have you heard of anything in version 10 that would create an issue? I have attached some images. it says that the Template is invalid.

Screenshot 2025-04-22 at 5.23.45 PM.pngScreenshot 2025-04-22 at 5.23.13 PM.pngThanks! 

Eric Sebian
Contributor
April 22, 2025
Here is the full error:
Action 'Post_card_in_a_chat_or_channel' failed.
The workflow was working up until the day that I made the change. The full error is: 
Unable to process template language expressions in action 'Post_card_in_a_chat_or_channel' inputs at line '0' and column '0': 'The template language expression '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'])' cannot be evaluated because property 'avatarUrls' doesn't exist, available properties are 'self, name, key, emailAddress, displayName'. Please see https://aka.ms/logicexpressions for usage details.'.
here is the the entry from the adaptive card: 
{
    "$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"
    }
}
Please advise. 
Eric Sebian
Contributor
April 22, 2025

there's also reference to the avatarURL in the Parse JSON 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"
                                ]
                            }
                        }
                    }
                }
            }
        }
    }
}
Eric Sebian
Contributor
April 23, 2025

Hi. you mentioned "please update the adaptive card schema by one mentioned in this article (updated card)." where is the new adaptive card schema mentioned? 

 

thanks. 

Like 원유준 likes this
Volodymyr Batrukh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 24, 2025

Hi @Eric Sebian 

I have tested workflows on Jira DC 10.6.0 and no issues found. The card was sent to the channel without any issues.
The updated card can be found on the first page (it was updated) or from this document.

Please try to recreate workflow using updated schemas.

Regards,
Volodymyr B.

Eric Sebian
Contributor
April 24, 2025

Thank you for checking. It's weird that it stopped working right after the upgrade, but I'll reconfigure from scratch and see if I can get it to work again. Thanks again. 

Eric Sebian
Contributor
April 24, 2025

Hi Volodymyr. After deleting the old entry and starting again. Though I still had issues. For one, when I try to create a workflow from blank now, it doesn't display all of the Dynamic content. 

So I had to create a workflow from the template. then it showed.

Screenshot 2025-04-24 at 2.38.11 PM.pngScreenshot 2025-04-24 at 2.33.37 PM.png

I notice now that it working again from the template, I have this empty --> empty. Any idea what that's from? 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events