Hi there, I thought I'd post a 'how to', because this was something that took me a while to figure out.
I wanted to get a simple feed of notifications from jira into a MS Teams channel. e.g. issue created, sends a notification so that my whole team can see that something has happened.
The first thing I tried was
- Create a new private channel in MS Teams. I then configured a connector for that channel. That was pretty easy.
- I then went to jira / administration / webhooks & created a webhook that sent a notification to my MS Teams connector.
This sounds like it should work & be pretty easy to set up, but I found that it doesn't work. I'm pretty sure that the reason why it doesn't work, is that MS Team connector can't accept the default JSON that is created by jira. It took me a lot of trial & error to determine that my connector was listening ok, and that the jira webhook was firing, but it just wasn't happy with the actual message that was being sent.
The ALTERNATIVE that I got working was this:
- Still using my MS teams setup as above (private channel with a connector configured)
- then rather than using jira/webhooks., I used Global automation & created a rule. I then had to make sure that I formatted the body of the message in a way that would be accepted by MS Teams.
First one:
- When: Issue Created
- Then: Send web request
In the Webhook URL, put the MS Teams connector URL
In the HTTP method: POST
Webhook body: Custom data
Custom data
{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content":{
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.2",
"body":[
{
"type": "TextBlock",
"text": "Jira issue created! Check it out here -> [{{issue.key}}](<your jira intance>/browse/{{issue.key}})",
"wrap": true
},
{
"type": "TextBlock",
"text": "**Issue Summary:** {{issue.summary}}",
"wrap": true
},
{
"type": "TextBlock",
"text": "**Issue Type:** {{issue.issueType.name}}",
"wrap": true
},
{
"type": "TextBlock",
"text": "**Created By:** {{issue.reporter.displayName}}",
"wrap": true
}
]
}
}
]
}
Save & publish!
This works for me - so thought I'd share it!!
An alternative method is to setup an "Incoming Webhook" in the MS Teams channel under the connectors, then in the specific Jira project use the automation to "Send Microsoft Teams message" to the webhook's URL.
Yes - that's correct. The screen shot above is an example of what comes through to Teams after an issue is created in my jira project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i cannot get the issue filed values into text.
Can you help me?
"text": "**Issue Summary:** issue.fields[summary]",
Issue Summary: {{issue.fields.summary}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Will this work for comments as well? Can I use {{issue.fields.comment}} to send the associated comment? Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Atlassian Community.
Are you able to send the notification to MS teams after issue is being created?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.