Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JMWE: How to access Epic Name via Epic Link?

Paul Alexander
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 25, 2022

Using a JMWE 'Create Issue' post function, on a Story parent issue, I am creating a subtask. In that process, I want to set the Summary of the newly inserted subtask to the Epic Name from the Epic Link on the current issue which is in the 'TST' project in this example.

The system has no mapping to the Epic Name since the Story has no Epic Name so it only returns the textual part of this template.

Foobar: {{ issue.fields["Epic Name"] }}
Result value:
Foobar:

I can use the Epic Link but this only provides the key. There does not appear to be a means to map from the epic link to the epic name or am I missing something obvious here?

Foobar: {{ issue.fields["Epic Link"] }}
Result value:
Foobar: TST-413

For clarity, the epic name behind TST-413 is 'Hello World' so I need to set the Summary to this.

Result value:
Foobar: Hello World

1 answer

1 accepted

0 votes
Answer accepted
Sayed Bares _ServiceRocket_
Community Champion
October 25, 2022

Hi Paul,

You can use the epic filter for the story to access the epic name, something like this should work:

{{ issue| epic("customfield_10011")|field("fields.customfield_10011")}}

(i) Replace  customfield_10011 with the Epic Name customfield ID <if it is not customfield_10011>

 

or you can use epic links to get it:

{{ issue.fields["Epic Link"]|issue|field("fields.customfield_10011")}}
Paul Alexander
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 26, 2022

Hello Sayed. Thank you very much. Either template works great. I'm diving in next to learn how this works. I've read most of the JMWE documentation but I'm likely missing a key page on basics about how we traverse the data like this. I appreciate your time.

Suggest an answer

Log in or Sign up to answer