Unable to integrate mattermost & jira

We are unable to integrate mattermost & jira in our environment. Have followed all the steps mentioned this url.
**As per the docs have enabled jira in mattermost, created secret. In jira created webhook with that URL got from mattermost. **
But we are not getting any notification after that integration.
Getting error in jira log like:
2019-05-06 08:50:27,575 httpclient-callbacks:thread-1 WARN anonymous 489x56x1 mg0p3l 10.X.X.X, /secure/SetupLicense.jspa [c.a.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Client error - 404 when posting to web hook at '/plugins/jira/webhook?secret=XXXX&team=devops&channel=isd-linux-notification’

Please help to fix the issue

Hi @shuhbam,

What Mattermost server version are you on? Do you also see errors in Mattermost logs? What Jira version are you using? Would you be open to sharing your Jira settings?

Mattermost version: 5.9.0
Jira version: 8.0.2
**Don’t see relevant errors related to webhook in mattermost logs.

Please let me know if you need any other info

Hi @shuhbam,

Did you have a chance to take a look at the troubleshooting section in the doc: https://docs.mattermost.com/integrations/jira.html#why-doesn-t-my-jira-webhook-post-any-messages?

Also, we currently only support these events: Created, Updated, and Deleted.

Hi @shuhbam,

In addition to the documentation that Amy asked to check out, seeing that the error is a 404, I suspect that the two servers (Mattermost and Jira) are unable to communicate with one another.

Just to confirm, are you able to telnet from the Mattermost server to Jira (and vice-versa)?

yes both the servers are able to communicate with each other.
And the issue is fixed now.
Issue was happening due to the Team name in the webhook. In the webhook I have given the display name of the team(mattermost) and webhook was not able to identify the team name(display name).
In mattermost display name of a team & the original name of the team is not always the same.
If you change the display name then it wouldn’t change the original name of the team.
In webhook it requires original name of the Team instead of display name.

The difference between the display name and the actual team name was causing the issue for me. To find the actual team name I executed the following steps:

  1. Obtain a authorization token (included in the response headers)
    curl -i -XPOST https://<mattermost.url>/api/v4/users/login -d '{"login_id":"<username>", "password": "<password>"}'

  2. List all the teams available
    curl -H 'Authorization: Bearer <token>' https://<mattermost.url>/api/v4/teams | jq .
    Result (fields omitted for privacy purposes):

   "display_name": "<omitted>",
   "name": "general",
   "description": ""

To integrate Jira with Mattermost you have to use the name field instead of display_name.

1 Like