Alternative Methods of Deleting Application Links in Confluence
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
This article outlines alternative methods of removing Application Link configuration in your Confluence instance as it cannot be deleted with the conventional way via Confluence UI.
Diagnosis
Before performing the steps from the Resolutions section, please first ensure that you've tried to delete the Application Link configuration from the Configure Application Links page (Confluence Administration page >> Application Links) as shown in the screenshot below.
If you are still unable to delete the configured Application Link, please then proceed to the Resolutions section of this KB.
Causes
Due to some data corruption in the Confluence Database, Application Links then cannot be deleted from Confluence UI.
Resolutions
We suggest our customers follow the resolutions highlighted below in sequential order as the latter resolution is highly risky.
Remove Application Link by Using a REST Endpoint
First, please run this
curl
command to identify the existing Application Links configured in your Confluence instance:curl -s -X GET -u <username>:<password> -H "Accept: application/json" <Confluence-Base-URL>/rest/applinks/1.0/listApplicationlinks | python -mjson.tool
In the example above, the application link ID is: "79f0263c-a3a5-323b-870c-aea1895cabeb"
Next, once you've identified the Application Link ID of the application that you'd like to remove, you may then run the following command to remove this Application Link configuration.
curl -X DELETE -u <username>:<password> -H "Accept: application/json" <Confluence-Base-URL>/rest/applinks/1.0/applicationlink/<JIRA-ApplicationLink_ID>
t
Manually Remove Application Link Directly through Confluence Database
If you are unsure how to deal with the database, contact your DBA. Make sure to have the database backed up completely before going further. These SQL commands were tested in some environments and they worked as intended.
However, it might not work in specific cases and newer versions of confluence as new constraints as changes may be done to confluence database structure. As such, a database backup is mandatory in case any issue arises and you'd need to rollback to the previous working state of Confluence Database.
- Make a note of the name of the link you want to delete, (e.g. JIRA in the example mentioned in the Diagnosis section above).
- Shut down Confluence
- Backup your database completely
Find the Application link ID:
SELECT * FROM BANDANA WHERE BANDANAKEY LIKE 'applinks%' and BANDANAVALUE like '%your link's name from Step 1%';
The application link ID will look like: "cfce37ac-1125-3e7f-93dd-17c643239204"
Find all entries for the application link from step 4, replacing the ID with yours:
SELECT * FROM BANDANA WHERE BANDANAKEY LIKE '%cfce37ac-1125-3e7f-93dd-17c643239204%';
Remove entries for that application link id:
DELETE FROM BANDANA WHERE BANDANAKEY LIKE '%application link id from Step 5%';
Update applinks.global.application.ids to complete the removal:
SELECT BANDANAVALUE FROM BANDANA WHERE BANDANAKEY = 'applinks.global.application.ids';
Example of output:
<list> <string>e0bea7ec-e080-35fd-b856-c942ed2f83cc</string> <string>cfce37ac-1125-3e7f-93dd-17c643239204</string> <string>034974ba-a91a-33aa-a715-aa15aa133374</string> </list>
Remove the line containing the ID from step 5:
UPDATE BANDANA SET BANDANAVALUE = '<list> <string>e0bea7ec-e080-35fd-b856-c942ed2f83cc</string> <string>034974ba-a91a-33aa-a715-aa15aa133374</string> </list>' WHERE BANDANAKEY = 'applinks.global.application.ids';
- Restart Confluence.
Note: A restart is required, as flushing Confluence caches is not sufficient to avoid further problems with removed applinks.
If you are using Trusted Applications as the authentication method, you will also need to run the following steps: