Automation For Jira - The "Delete Issue Links" action does not delete any link
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
要約
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:
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.
環境
- 8.0.0 以降の任意のバージョンの Jira Server/Data Center
- Automation For Jira Server/Data Center on any version from 7.4.0
診断
- Open the issue from which the rule was triggered, and verify that it has at least one link to another issue
Create a new automation rule using the manual trigger, add a "log action" action with the message below:
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:
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:
<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:
- 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:
- 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":
- 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.
原因
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.
ソリューション
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:
- 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):