Copy field values from issues linked via the Parent Link field using Automation for Jira

Thomas Hardin May 11, 2021

Hello all,

I am new to Automation for Jira and have a scenario that I could use some help with. We use the Advanced Roadmaps hierarchy to link most of our work in the following manner:

Portfolio Epic > Program Epic > Epic > Story

Linking our Epics to Program Epics and up is accomplished using the Parent Link field. We are in process of migrating to the cloud and want to leverage Automation for Jira, which will help us to reduce our effort fixing workflows and feel that we have some opportunities.

Where we seem to be falling a bit short is figuring out how best to use Automation to copy field from those parent issues when they are created. Example: If I create an Epic, connect it to a Program Epic using the Parent Link, then I want to copy fields from that Program Epic onto my Epic.

Using Automation, my thought is to have:

1. Issue Create Trigger

2. Condition to determine if Parent Link is not empty

2a. If not empty then copy fields from Parent issue

 

I started with Comparing values but this does not seem to work

{{issue.customfield_15004}} does not match regular expression (^null$|^$)

And my understanding is that JQL has some performance impacts, so it is better to use smart values where possible.

Now, we are not trying to solve all the world's issues yet, but if we could get some assistance or recommendation on how best to approach this scenario, would would be greatly appreciative as our next step will be to build on this so we have 1 rule to manage several issue types within our hierarchy.

 

Thanks in advance.

4 answers

1 accepted

2 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.
May 11, 2021

Hi @Thomas Hardin 

My understanding from an Atlassian's rule engine developer's community post is that most everything in rules is driven by JQL queries and the API, so I wouldn't worry about performance of a rule until you see performance issues for the rule.  Then investigate improving it and monitor it over time.

That being noted, I suggest creating your rule and improve it as you go.  If you have problems creating the rule, please post an image of your rule, the audit log, and the symptoms you observe.  That will help the community give you suggestions.

The one challenge I expect you to run into is: are all of the fields you want from advanced roadmaps available?  One way to determine that is check for the smart values using techniques from this article: 

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Best regards,

Bill

Thomas Hardin May 12, 2021

@Bill Sheboy Thanks for the reply. So, my goal isn't to copy actual Roadmap fields, but to copy fields from the Parent issue of the Epic, which is linked via the Parent Link field. Here, when and Epic is created, I need to determine if the Parent Link is populated, and if so, go get the issue key and copy fields from it onto the Epic. In this case, the first field I'm trying to copy is the Account field from Tempo. 

Here is my initial rule:

Copy Account Rule.png

I thought I could use the Branch option to find the parent issue key using jql and the trigger issue, which would then pull the account field:

Copy Account Edit Action.png

Unfortunately, when I attempted to create my Epic, the result was that no actions were performed.

Copy Account Log.png

 

I hope my thought process is somewhat in the ballpark:

1. Create an Epic

2. If Epic has a Parent (Parent Link is not empty)

3. Go find Parent issue

4. Copy fields from Parent issue

 

Thanks for any advice or assistance!

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.
May 12, 2021

Thanks for that information.  First, let's review how to accomplish what you asked and then second review your current rule.

First, to accomplish your goal:

  • Writing to the audit log is helpful, so consider adding some log actions to see if you are getting what you expect...like after that JQL condition
  • Rather than using the branch and edit, you can just use the edit action, and after you select the field, note the ... menu at the right side.  You can select to copy from parent from there

Second, to review your current rule:

  • Your branch is on the JQL to match to the parent link, and that will try to match to *all* issues with that parent.  That may not be what you wanted.
  • When you are inside of a branch and use edit issue, you are editing each issue the branch finds; not the triggering issue (the one created)

Please let me know how that works for you.

Like aoros likes this
Pillai_ Aarthi May 2, 2023

@Thomas Hardin could you let me know if the above automation worked? 

0 votes
Steven Camilleri September 20, 2023

I know i'm late to the party but I managed as I needed to do something similar:

Capture.PNG

Capture.PNG

0 votes
Dawn Cooper May 9, 2023

the answer was to break down the post functions into separate post functions in that same workflow transition. 

0 votes
Dawn Cooper November 17, 2022

I tried using the JSU Post Function for a Parent/Child to and Epic, and it says success, but the child issue does not reflect the copied data. :(  this is on the Story workflow for create. Not finding the answer in JSU documentation. Any suggestions here? 

Post Function to copy fields from parent Epic to child Story.png

Suggest an answer

Log in or Sign up to answer