Automation For Jira - The "Delete Issue Links" action does not delete any link

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

The "Delete Issue Links" action does not delete any link from a Jira issue even though there are links to other issues as per the "Issue Links" panel.

When checking the automation rule audit logs, we can see that no action is performed:

Audit log entry

The purpose of this knowledge base article is to describe one possible scenario where the "Delete Issue Links" action does not work as expected, how to identify it, and how to fix it.

Diagnosis

  • Open the issue from which the rule was triggered, and verify that it has at least one link to another issue

Issuelinks_blocks
  • Create a new automation rule using the manual trigger, add a "log action" action with the message below:

1 Inward: {{issue.issuelinks.inwardissue.key}} Outward: {{issue.issuelinks.outwardissue.key}}
  • Trigger the rule from the issue, check the Rule audit logs, and notice that the rule is not able to find any inward nor outward issue link:

Rule unable to find any inward/outward issue link
  • Open the URL below in a new browser tab, after replacing <JIRA_BASE_URL> with Jira's Base URL and <issue_key> with the issue key, and check the output:

1 <JIRA_BASE_URL>/rest/api/2/issue/<issue_key>
  • In the API response, search for the string "issuelinks" (which is the JSON key name for the "Linked Issues" field), and notice that this string is missing from the API response:

API response
  • Go to ⚙ > Issues > Field Configurations

    • Click on the Config button next to the Field Configuration used by the project the issue belongs to

    • Scroll down all the way to Linked Issues, and notice the Show link next to this field, which indicates that this field has been set to "hidden":

      Field_hidden

    • If the Show link is visible next to this field, then this KB article is relevant and you can move on to the Solution section.

Cause

When the Linked Issues field is configured to be "hidden", the following will happen:

  • The issuelinks field will not longer be available from Jira's REST API

    /rest/api/2/issue/<issue_key>

  • Since automation rules rely on the response from this API to access issue data, the data from the "issue links" panel will no longer be available to these rules

  • As a result, the "Delete Issue Links" action will no longer be able to see the issue links and delete them, and the "No actions were performed" message will be shown in the audit logs

Note:

  • Even though this field is set to "hidden", it will still be possible to link issues, and the "Issue Links" panel will still be visible from the "View Issue" screen.

  • The fact that the Issue Links are showing in the View Issue screen but not in the REST API response is tracked as a bug is tracked in the ticket https://jira.atlassian.com/browse/JRASERVER-76720. The purpose of this bug ticket is to report the inconsistency between the Jira UI and the REST API.

Solution

The solution consists in making the "Linked Issues" field visible in the "Field Configuration" associated to the project that the issue belong to:

  • Go to ⚙ > Issues > Field Configurations

  • Click on the Config button next to the Field Configuration used by the project the issue belongs to

  • Scroll down all the way to Linked Issues

  • Click on the Show link

To verify that the solution worked, you can:

  • Either access the API link <JIRA_BASE_URL>/rest/api/2/issue/<issue_key>, and check that the issuelinks field is now available in the response:

Check for Issuelink field
  • Or run again the automation rule described in the Diagnosis section of this article, and verify that the log action is now showing some data (either for the inward or outward link):

Verify using log action

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.