How can I copy the summary from an Epic issue that is linked to my "Change" issue type

Diego Martínez October 29, 2024

 

 

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?

 

 

Captura de pantalla 2024-10-29 150925.png

2 answers

2 accepted

3 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 29, 2024

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.

  • trigger: issue transitioned
  • condition: issue type equals Cambio
  • action: lookup issues, with JQL to get your Epic linked to the trigger issue
    • issue IN linkedIssues( {{triggerIssue.key}}, the link type you are using) AND issueType=Epic
  • advanced compare condition
    • first value: {{lookupIssues.size}}
    • condition: equals
    • second value: 1
  • action: edit issue to set the field to {{lookupIssues.first.summary}}

Kind regards,
Bill

Diego Martínez October 29, 2024

Thank you very much for your suggestion! However, my instance of Jira does not have the Lookup Issues action available. :(

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 29, 2024
Like Diego Martínez likes this
Diego Martínez October 29, 2024

Oh, that's the problem; we're using version 8.20.30.
:(

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 29, 2024

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

Like # people like this
Diego Martínez October 29, 2024

: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"?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 29, 2024

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.

2 votes
Answer accepted
Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 29, 2024

Hi @Diego Martínez,

Try this smart value:

{{epic.Summary}}

screenshot 2024-10-29 222133.png 

Diego Martínez October 29, 2024

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. :(Captura de pantalla 2024-10-29 153954.png

 

 

Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 29, 2024

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.

Like Diego Martínez likes this

Suggest an answer

Log in or Sign up to answer