How to update the list of linked issues into a multiline text custom field.
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
How to update the list of linked issues into a multiline text custom field.
Environment
Jira Cloud
Solution
Using automation, we can update the multiline text fields(Comments, description, customer fields). To achieve this we need to create two automation rules: the first rule executes when the issue is linked, and the second rule executes when the linked issue is removed.
1. When an issue is linked:
- Add a 'Issue linked' trigger for All link type
- Add a 'Branch rule / related issues' to update destination issues
- Select 'Type of related issues' as 'Linked issues'
- Link type as All link type
- Check 'Only include issues that have changed since the last time this rule was executed' to increase the automation performance by skipping the issues that have not been updated since the last execution.
- Add the 'Edit issue' action and select the multiline field
- Use the below smart values to get all linked issue keys or outward or inward keys/URLs (choose as per your requirement)
- Add an edit issue action in the Main branch to edit the source issue and use the below smart values to get the issue links(inward/outward)
Refer to the screenshot or import the automation JSON for more details:
automation-rule-17235776-202401100744_2024-01-10T07:44:39.014Z.json
2. When the linked issue is removed:
- Add a 'Issue link deleted' trigger for All link type
- Add a 'Branch rule / related issues'
- Select 'Type of related issues' as 'Destination issue'
- Add the 'Edit issue' action and select the multiline field
- Use the below smart values to get all linked issue keys or outward or inward keys/URLs (choose as per your requirement)
- Add an edit issue action in the Main branch to edit the source issue and use the below smart values to get the issue links(inward/outward)
- Refer to the screenshot or import the automation JSON for more details:
automation-rule-17246570-202401100755_2024-01-10T07:55:48.419Z.json
Outward links: blocks, clones, duplicates, etc, and Inward links: is blocked by, is cloned by, is duplicated by, etc
All linked issue key : {{issue.issuelinks}}
Outward URL:{{issue.issuelinks.outwardIssue.url}} / Outward Key:{{issue.issuelinks.outwardIssue}}
Inward URL{{issue.issuelinks.inwardIssue.url}} / Inward Key:{{issue.issuelinks.inwardIssue}}
Notes:
- Ensure 'Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule.' This is checked under your rule details so this automation can be triggered when any other automation rule links issues.
- Make sure the rule scope is set to multi-project/global if you want to execute the rule for multiple/all projects.