Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

When creating a new epic, I want an automation rule to copy the parent initiative field values (wsjf

Carrol Patterson April 24, 2023

Trigger:  Issue Created

Condition:  If Issue Type equals Epic

Action:  copy the new epic's parent WSJF field values to the new epic.  

problem:  "Issue to copy value from"  "Parent Issue" doesn't work for epics

1 answer

0 votes
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.
April 24, 2023

Hi @Carrol Patterson 

Are you using Jira Cloud or Server/Data Center version?  Let's assume Cloud...

In that case, you could use advanced edit with JSON (under More options for the Issue Edit action) to copy the field from the parent data to the new epic, as described here: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/

But first...I recommend confirming that your field is supported by automation rules and to confirm the exact smart value name (or custom field id).  You can do that using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Kind regards,
Bill

Carrol Patterson April 25, 2023

Jira v9.4.1

Server/Data Center Version

I was able to create this rule:

Trigger - when values change for WSJF BV, WSJF RR | OE, WSJF TC

Condition:  If Issue type equals Initiative

JQL - project in (CMSSANDBO2) AND issuetype = Epic AND issuekey in childIssuesOf({{triggerIssue.key}}) 

Condition:  Issue Type equals Epic

Edit Issue

Copy WSJF BV from Trigger issue

 

Now i want to do the same thing in the other direction

Trigger:  When a new epic is added or epic is moved

copy the WSJF values from the parent initiative down to the epic

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.
April 25, 2023

Let's try this...When an issue has a parent, some of the fields appear to be directly available to a rule, such as like below.  This does not always work for all fields; if it did a single rule could pull in a lot of issues/data in a chain.

{{issue.parent.myCustomField}}

I believe with the relationships your issue is using, the parent field may work correctly even though the rule doesn't acknowledge it for "copy from parent".

If that does not work, we can investigate another approach.

Carrol Patterson April 26, 2023

Sorry - it took me a while to get back to this.  I don't think "parent" works for Initiative parents of Epics.

This is what I tried:

Trigger:  Issue Created

Condition:  If Issue Type = Epic

Condition:  And if parentIssuesOf ({{triggerIssue.key}}) does not equal null

Edit Issue:  Then WSJF BV copy from Parent issue

 

When I trigger it by creating a new Epic as a child of an existing Initiative here are the logs:

first 2 conditions passed

edit issue failed "can't find issue to copy from customfield_10571

no fields or field values to edit for issues (could be due to some field values not existing in a given project)

 

Which doesn't make sense because I could do the same fields in the other direction.  I think it's because it doesn't recognize "parent" of an epic.

Is there another way to do it?

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.
April 26, 2023

I was not suggesting to try "copy from parent" again from the edit options.  Instead you can try editing the field and entering the smart value directly:

{{issue.parent.myCustomField}}

When you do this, the smart value expression will appear below the edit value, and you can select it so the rule will use it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events