[Solved] Getting invalid_grant type to connect jira on mattermost

Hi Team,
I’m trying to connect Jira on my Mattermost service by flowing the guidelines Mattermost Integrations for Jira

While try to connect to Jira using /jira connect, at the time its redirecting to jira page, but suddenly its showing an error like this

could not get user info for a client, err: No response returned: Get "https://mattermtest.atlassian.net/rest/api/2/myself": oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Invalid aud: https://auth.atlassian.io"}

we are having the exact same problem

Also running into this issue. Has anyone had any luck with a solution?

Hey y’all! Thanks for bringing this up, and I’m sorry to hear that you’re facing issues while connecting Jira to your Mattermost service. The error message you shared indicates a problem with the authentication process. It seems that the token being used for authentication is invalid.

To troubleshoot this issue, I recommend the following steps:

  1. Verify the configuration: Double-check the integration settings in Mattermost and ensure that you have entered the correct Jira URL and credentials.
  2. Check the Jira API configuration: Make sure that the Jira API settings are properly configured to allow access from Mattermost. Check if the Jira REST API is enabled and accessible.
  3. Check the Jira application link: Ensure that the application link between Jira and Mattermost is correctly established. If it exists, try removing and recreating the application link to refresh the connection.
  4. Verify Jira user permissions: Ensure that the user account used for the integration has the necessary permissions in Jira to access the REST API and retrieve user information.

If the issue persists after following these steps, you may need to reach out to the Mattermost support team for further assistance. They will be able to help you troubleshoot the specific issue by analyzing logs and providing additional guidance.

Let me know if there’s anything else I can help you with!

Best regards,
~Matterbot 2.0 :robot:

[Disclaimer: This is a new AI response feature we’re testing powered by ChatGPT. Please note that this suggestion may not always reflect official Mattermost recommendations or support.
Were any of the above suggestions inaccurate? Let us know by replying to this comment!]

Finally figured it out. Final solution was:

  • Update to latest Jira plugin inside Mattermost
  • Make sure Jira instance is uninstalled in Mattermost /jira instance uninstall <INSTANCE>
    One note that we could not easily remove our Jira instance from Mattermost so we had to manually nuke all the Jira plugin settings by running a database command.
DELETE FROM pluginkeyvaluestore WHERE pluginid='jira';
  • Delete Mattermost plugin on Jira side if it exists
  • From Mattermost re-run the setup and go through process of regenerating a new token and installing the Mattermost plugin within Jira /jira setup

Hope this helps somebody.

1 Like

Woot! Thanks for following up with the solution, Lmorroni!

Happy Mattermosting out there!