Jira plugin - user can't connect or disconnect

Summary
One particular user gets ‘your Mattermost account is already linked’ when doing /jira connect but gets ‘your account is not connected’ when doing /jira disconnect

Steps to reproduce
Mattermost 10.5 Jira plugin 4.2.1

Expected behavior
This Mattermost instance was recently updated from 5.x to 10.5 through all of the required intermediate versions. The DB was dumped from Postgres 9.x and imported into Postgres 14.x. Everything else is working as expected and other users can connected and disconnect from Jira. This user’s ‘/jira me’ shows an Orphant connection that includes his name, key, email address where working users seem to have blanks in those areas when they are disconnected.

Observed behavior
One user can’t /jira connect or /jira disconnect. They seem to be half connected. Available server is correct.

Thanks for the detailed report, @jfath. This looks like an orphaned user mapping; ask the affected user (or a sysadmin on their behalf) to run /jira disconnect <your-jira-url> then /jira connect again, and if it persists, have a sysadmin remove the stale mapping for that user on the specific instance per our Jira integration guide here: Connect Jira to Mattermost - Mattermost documentation