Mattermost, Inc.

Jira plugin can't create issues

Summary

The Jira plugin works OK when posting events to channel but hangs up while trying to create or attach to the issue.

Steps to reproduce

Mattermost Version: 5.13.1 with preinstalled Jira plugin
JIRA cloud instance
Configure plugin and Jira according to the guide

Expected behavior

Successful creation of issues.

Observed behavior

I’ve successfully configured the plugin to post events from Jira Cloud to Mattermost channel, but after installing it as an application I can’t configure it to create tasks in Jira.

When I enter /jira connect command and click on the link bot gives me link with the url https://<MM-URL>/plugins/jira/user/connect. I successfully connect my jira account and everything looks good. But when I want to create an issue from any message, ruight-click on it and select “create jira issue” I receive a pop-up window with endless “Loading…” message.
In the mattermost logs i see the following error:

{"level":"error","ts":1564400037.2892468,"caller":"mlog/sugar.go:23","msg":"ERROR: ","plugin_id":"jira","Status":"500","Error":"user not found","Host”:”<MM-URL>”,”RequestURI":"/plugins/jira/api/v2/get-create-issue-metadata","Method":"GET","query":""}

@netgineer Thanks for the report. Can you help with the following information:

  1. Can you open the JavaScript console (instructions on various browsers can be found here), then try to create the Jira issue, and then paste the output of any errors here?
  2. Which browser or desktop app have you reproduced this on?
  3. What is the version of your JIRA cloud instance? (you may need to ask your Jira Admin if you’re not one yourself)

@jasonblais thanks for your response. Here is the information you requested.

  1. I’m getting this error while pressing the “create issue” button.

  2. Tested in the Mattermost app Version 4.2.1 for macos, Firefox 68.0.1 and Chrome Version 75.0.3770.142 (Official Build) (64-bit) also for macos.

  3. Jira Cloud is always the latest version, “About” menu says its JIRA 1001.0.0-SNAPSHOT

Thank you! This is really helpful

  1. This helps, but can you actually help take a screenshot of the JavaScript console - you can find it by selecting the “Console” tab in the window you opened

2 / 3: Thanks! Makes sense regarding the Jira Cloud version

Once I have the Console errors, we should have enough info to troubleshoot what’s causing the issue

My bad, i thought they are the same. Here is the one you ask for:

12:35:50.487 XHRGEThttps://<MM-URL>/plugins/jira/api/v2/get-create-issue-metadata
[HTTP/2.0 500 Internal Server Error 10ms]

Request URL:https://<MM-URL>/plugins/jira/api/v2/get-create-issue-metadata
Request method:GET
Remote address:95.47.173.20:443
Status code:500
Version:HTTP/2.0
	
Response headers (218 B)	
content-length	15
content-type	text/plain; charset=utf-8
date	Tue, 30 Jul 2019 09:35:50 GMT
server	nginx
vary	Origin
x-content-type-options	nosniff
X-Firefox-Spdy	h2

Request headers (530 B)	
Accept	*/*
Accept-Encoding	gzip, deflate, br
Accept-Language	en-GB,en;q=0.5
Connection	keep-alive
Cookie	ajs_user_id=%22ciytkeb683f85bz…ID=t6tqx7fudpypu8xwktwwsfagdh
DNT	1
Host	<MM-URL>
TE	Trailers
User-Agent	Mozilla/5.0 (Macintosh; Intel …) Gecko/20100101 Firefox/68.0
X-Requested-With	XMLHttpRequest

Also, I’ve noticed that I have to connect to Jira everytime i open mattermost in a browser or quit and start the app. And after connecting account in the Jira interface, it says

Your Jira account is now connected with Mattermost
Mattermost account: <my-name> (@<my-username>)
Jira account: <my-name> () <---- no username here

Is this correct? A little bit suspicious that mattermost says "user not found" and my Jira username is empty.

@netgineer What happens if you try to /jira disconnect then /jira connect - and try again. Does the problem persist?

@aaronrothschild I tried to /jira disconnect and got this message:

Could not complete the disconnection request. You do not currently have a Jira account linked to your Mattermost account.

then I tried to connect, got a pop-up window with Jira interface, pressed the Approve button and entered /jira disconnect again, but got the same message.

Also, when I pressed the Disconnect button in the pop-up I got this error message with my userId:

failed to delete user, mattermostUserId:t6tqx7fudpypu8xwktwwsfagdh: user not found

Seeing similar issues on with the integration to Jira Cloud on a recent upgrade to 5.12.

I’m able to run /jira connect and it says successfully connected, but running /jira disconnect right after says I do not have an account linked.

HI Danny,

Can you run /jira commands after you have ‘connected’?
What version of Jira are you running against (Cloud, Server, Data Center) and how many projects do you have approximately?
Are you able to execute any jira commands or only having trouble with some?

Thanks,
Aaron

(As an aside, In jira 2.1 we added the command /jira info to more easily access troubleshooting info)

Hi Aaron,

We’re running Mattermost 5.12.5 against Jira Cloud. We have about 6 or 7 projects. None of the /jira commands work after connecting.

Hi @Danny and @netgineer,

Would either of you be willing to provide a payload being sent to your Mattermost server from Jira causing this issue (with redacted info)? I can walk you through if you’re not sure how to do so.

Michael

@mickmister Sure. What do you want me to do?

@mickmister same here, let me know how I can help.

@netgineer @Danny

You can send me a DM on the community server at https://community.mattermost.com if you would like, and we can go from there. My username on there is michael.kochell

Thank you!

I had this issue after changing my email on Jira which switched me off of my google login. Not really a fix but I resolved it by /jira uninstall and /jira install, then it asks for the login details again and asks for permissions.