I create an issue of type "Change" and link it to an issue of type "Epic." When the "Change" issue transitions to the "In Progress" status, I want to update a custom field called "Epic Name | CAB" in the "Change" issue. This field should take the value from the summary of the linked "Epic" issue.
How can I set up an automation rule to accomplish this in Jira?
Hi @Diego Martínez -- Welcome to the Atlassian Community!
As you are using linking to connect the issues, I recommend using the Lookup Issues action with JQL to get the linked Epic, and then access the Summary.
Kind regards,
Bill
Thank you very much for your suggestion! However, my instance of Jira does not have the Lookup Issues action available. :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which version of Jira Data Center are you using, as I believe that action was added over a year ago:
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.
Okay, let's try using smart value, list filtering with the issuelinks smart value! This would replace the lookup and advanced compare, providing the Summary value directly.
I am using Jira Cloud, so you may need to experiment a bit. In my example below, I am looking for any issues linked to the trigger with a link type of "blocks", and returning the Summary, so substitute in your link type.
{{#issue.issuelinks}}{{#if(equals(type.outward,"blocks"))}}{{outwardIssue.summary}}{{/}}{{/}}
This will return all the issues' summary values which are blocked. Is there one-and-only-one linked Epic with the type you need? If not, additional filtering may be required.
The key to figuring stuff like this out is to use the how-to article below, and look at an example issue. You can then see the JSON structure, and how to filter the fields.
https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
:D Thank you very much, I was able to achieve it with that smart value you provided, thank you very much.
Could I do this for any custom field by modifying the "outwardIssue.summary"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
And regarding using custom fields in that expression, I suspect the answer is "no", but feel free to experiment and try it. If it works for Data Center, please let me know!
If not, here is what is happening...and please feel free to stop reading if you wish :^)
When things like the issuelinks and subtasks smart values are referenced in an issue from a rule, they only load a small number of the fields (e.g., key, summary, type, status, and priority). If they brought in all of the fields, you could imagine a tree of issues pulling in a massive amount of data, ever increasing as each one pulled in more connected issues.
For Jira Cloud, my understanding is each reference to {{issue.subtasks}} in a rule calls the REST API to load data for the subtask, but still only some of the data. To get the remainder, one must use Lookup Issues, a branch, or the REST API.
For Jira Data Center, even Lookup Issues is limited in what fields it can currently access. The workarounds for that are to use the bulk-handling feature of branches / scheduled triggers, or to use the Send Web Request action to call the REST API and search for issues with JQL. Those would return all of the issue fields.
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.
Thank you very much.
It seems that method didn’t work. It may be due to how the issues are linked, but there’s also no error message; the field value simply doesn’t update. :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, I see. I thought that the Epic link field is used for linking these two issues.
@Bill Sheboy's solution should work, give it a try.
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.