Jira Plugin: OAuth error on API calls to Jira

Description

The Jira API calls are returning a `400 Bad Request` because of the Jira userkey deprecation for the GDPR migration. Here are some Jira docs explaining the deprecation:
https://developer.atlassian.com/cloud/jira/platform/api-changes-for-user-privacy-announcement-connect
https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide

Here is the error that we receive when opening the `Create Issue` modal or the `Channel Subscriptions` modal:

1 2 failed to get CreateIssue metadata: Get https://mmtest.atlassian.net/rest/api/2/issue/createmeta: oauth2: cannot fetch token: 400 Bad Request Response: {"error":"invalid_grant","error_description":"Deprecated subject claim prefix urn:atlassian:connect:userkey: cannot be used when opted in to GDPR API migration"}

Here is the error we receive when trying to `/jira connect`:
`invalid JWT: no user data`

QA Test Steps

Authentication

  • Connect

  • Disconnect

  • Mapped user's name displays correctly in Jira when making changes to issues and comments

  • Disconnect and re-connect as a different user

Create issue (All issue types)

Attach comment

  • Working as expected

  • Permissions are respected

Transitions

  • Transitions work

  • Transitions Permissions are respected

Status

Mana

4

Assignee

Christopher Poile

Reporter

Michael Kochell

Epic Link

None

Mattermost Team

Integrations

Sprint

None

Labels

None

GitHub Issue

None

QA Assignee

Dylan Haussermann

QA Testing Areas

Plugins