Microsoft Teams for Jira has the same OAuth key and ID after migration
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
After restoring an XML backup into a new instance, the Microsoft Teams for Jira configuration page retains the OAuth key and Jira ID from the original instance.
Diagnosis
After creating a new application link, the Jira ID from the original instance is provided as part of the integration:


Uninstalling and reinstalling the app (or recreating the application link) does not resolve the problem.
Cause
The integration data is stored within the database and is not cleared when removing the app or application link.
Solution
Resolution
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
To clean the Jira Server database from tables generated by the app, run the following scripts:
MS SQL Server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DECLARE @cmd varchar(4000)
DECLARE cmds CURSOR FOR
SELECT 'drop table [' + Table_Name + ']'
FROM INFORMATION_SCHEMA.TABLES
WHERE Table_Name LIKE 'AO%APP_KEYS' OR Table_Name LIKE 'AO%TEAMS_ATLAS_USER'
OPEN cmds
WHILE 1 = 1
BEGIN
FETCH cmds INTO @cmd
IF @@fetch_status != 0 BREAK
EXEC(@cmd)
END
CLOSE cmds;
DEALLOCATE cmds
MySQL
1
2
3
4
5
6
7
8
SET @tables := NULL;
SELECT GROUP_CONCAT(TABLE_NAME) INTO @tables FROM information_schema.tables
WHERE TABLE_NAME LIKE BINARY 'AO%APP_KEYS' OR TABLE_NAME LIKE BINARY 'AO%TEAMS_ATLAS_USER';
SET @tables = IFNULL(CONCAT('DROP TABLE ', @tables),'SELECT NULL;');
PREPARE stmt1 FROM @tables;
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
Oracle
1
2
3
4
5
6
7
8
BEGIN
FOR c IN ( SELECT table_name FROM user_tables WHERE table_name LIKE 'AO%TEAMS_ATLAS_USER' OR table_name LIKE 'AO%_APP_KEYS' )
LOOP
EXECUTE IMMEDIATE 'DROP TABLE ' || c.table_name;
END LOOP;
END;
DROP SEQUENCE AO_A07C39_TEAMS_ATL2031287131;
DROP SEQUENCE AO_A07C39_APP_KEYS_ID_SEQ;
Postgres
1
2
3
4
5
6
7
8
9
10
11
12
13
14
DO
$do$
DECLARE
_tbl text;
BEGIN
FOR _tbl IN
SELECT quote_ident(table_name)
FROM information_schema.tables
WHERE table_name LIKE 'AO%APP_KEYS' OR table_name LIKE 'AO%TEAMS_ATLAS_USER'
LOOP
EXECUTE 'DROP TABLE ' || _tbl;
END LOOP;
END
$do$;
Was this helpful?