I want to create an automation rule.
1. When: Issue linked
2. Then: Send web request
Webhook body: Custom data
{
"parent" : "{{issue.Key}}",
"child" : "{{destinationIssue.Key}}",
"linkID": "{{}}",
"type": "{{linkType}}"
}
But I could not find proper information to get id of the created link.
Plz give some information.
Thanks.
Hi @Semin Chang ,
Have you tried using below? It works perfectly on data-center as well as on Cloud.
Inward Issue is {{issue.issuelinks.inwardIssue}}
Outward Issue is {{issue.issuelinks.outwardIssue}}
You can find more details on this page -> https://confluence.atlassian.com/automation/smart-values-for-issue-links-in-automation-for-jira-1384120362.html
BR,
Gaurav
Hi @Gaurav Arora ,
In Project Automation page, Jira provides several data for easy handling.
Rule executes when an issue is linked to another issue. {{issue}} will always refer to the source issue, so if ISSUE-A is blocked by ISSUE-B, this rule will execute on ISSUE-B. To access ISSUE-A, use {{destinationIssue}}, and to access the link type, use {{linkType}} (e.g. {{linkType}}='Duplicate').
So I use {{issue}} and {{destinationIssue}} and {{linkType}}, and I need to get the link id when link is created, also.
I can access links by using {{issue.issuelinks}}.
But if there are several links then how can I get the proper link id in the automation rule page?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Semin Chang -- Welcome to the Atlassian Community!
The smart value {{issue.issuelinks}} contains the information for all of the links. Please try using that one with smart value, list filtering to access the link id for your specific issue link: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
I tried to use the below codes, but destinationIssue.Key is null in if-condition. Because "inside of an iterator, nothing above that level of scope is visible".
{{#issue.issuelinks}}
{{#if(exists(outwardIssue))}}
{{#if(equals(outwardIssue.Key, destinationIssue.Key))}}
{{id}}
{{/}}
{{/}}
{{/}}
As an alternative, link id and outwardIssue.Key are sent in pairs, and the receiving side filters them with child.
{
"parent" : "{{issue.Key}}",
"child" : "{{destinationIssue.Key}}",
"link": "{{#issue.issuelinks}}{{#if(exists(outwardIssue))}}{{id}}:{{outwardIssue.Key}}{{^last}},{{/}}{{/}}{{/}}",
"type": "{{linkType}}"
}
Is there any good suggestion?
Thanks,
Semin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.