Forums

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

Jira notification feed into Microsoft Teams channel

Jean Innes
Contributor
March 4, 2022

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!!

 

 

 

5 answers

2 votes
Jamie Carey
Contributor
May 24, 2022

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.

example.png

1 vote
Jean Innes
Contributor
March 5, 2022

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. 

0 votes
Maurice Stassen
Contributor
January 22, 2024

i cannot get the issue filed values into text.
Can you help me?

"text": "**Issue Summary:** issue.fields[summary]",

Issue Summary: {{issue.fields.summary}}

Eric Sebian
Contributor
August 2, 2024

Will this work for comments as well? Can I use {{issue.fields.comment}} to send the associated comment? Thanks in advance. 

 

0 votes
Sachin Dhamale
Community Champion
March 4, 2022

@Jean Innes ,

Welcome to the Atlassian Community.

Are you able to send the notification to MS teams after issue is being created?

0 votes
Jean Innes
Contributor
March 4, 2022

msg.PNG

Suggest an answer

Log in or Sign up to answer