Can I use Automation to copy a field value from a Portfolio Parent?

Pete Singleton
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.
July 21, 2020

We are using Portfolio for Jira to create a hierarchy of:

Capability -> Epic ->Story

I want to use Automation Pro for Jira, so that when an Epic is created, a custom field value from the Parent (Capability issue) is copied to the Epic.  I can't see how to do this currently.

1 answer

1 vote
Robert Levelind July 21, 2020

Hi Pete

I struggled with this a bit in the beginning as well - but first step is to figure out the customfield_id. 

You can find your custom field id:s by browsing your project with the REST API.

https://<your project>.atlassian.net//rest/api/2/issue/<ISSUE ID>?expand=names

By utilising this on a capability issue you should be able to find the issue id:
Example: customfield_10019

Within Automation Pro you should be able to fetch the value using {{issue.parent.fields.customfield_10016}}


Pete Singleton
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.
July 21, 2020

Perfect, thanks... I didn't realise you could use issue.parent in the JSON.

Like Vahid Shukurov likes this
Pete Singleton
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.
July 21, 2020

Actually, can't get this to work even though the Automation rule reports success.  I'm setting the custom field to a smart value {{issue.parent.fields.customfield_15780}} and it is still blank after the rule executes.  The parent issue definitely has this value set, and is linked with the Portfolio "Parent Link" field.

Robert Levelind July 21, 2020

Actually - could you try this using straight up copying.

When: Issue Created 
If: Issue Type equals Epic
Then: Edit issue fields "Copy Capability Issue" from Parent Issue.

And just double checking here - Is Capability Issue enabled on the Epic level as well? 

Can you see anything useful in the audit log? 

Pete Singleton
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.
July 21, 2020

No, the "Copy from parent" only works for sub-task issue types.  I believe that must be the same for the {issue.parent....} field too.  Seems to be a limitation of Automation.

Edwin Stol November 2, 2020

Hi @Pete Singleton - you are correct.
A4J has a feature request to implement this: JRACLOUD-74105 

The 'parent' option in 'Branched issues' only works for sub-tasks and their parent.

You could try @Scott Harwood 's solution mentioned. here :

* Trigger: Issue Transitioned
* Issue Condition: Issue is Epic & Status is in Progress
* Related Issue Branch (JQL): "key = {{issue.Parent Link}}"
** Transition Action: Copy from trigger issue

 

In addtion: if you have Scriptrunner available, or are willing to evaluate, you might be able to do something with the 'Parent Issue Field' or the Portfolio JQL options.

Good luck,

Edwin.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events