How to inherit a custom field (PID) value from an Epic when creating a Story or Task?

daniela zanini December 2, 2024

 

 

Hello,

I need to create an automation rule where whenever a STORY or TASK is created, it should inherit a custom field (PID) value from its "EPIC". This requirement should work both when the issue type is created using the "Create" button and when it's created from within the "parent" issue type using the "More" option.

I have tried using an automation rule with a branch on the Epic, along with a "Refresh Data" action before the branch. However, this does not seem to work, as the automation cannot recognize the Epic Link value, likely because it's not saved yet when the automation runs.

Has anyone encountered a similar issue? Any suggestions on how to resolve this?

Thanks in advance!

 

jira_automation.png

3 answers

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hello @daniela zanini 

Welcome to the Atlassian community.

Branching to the Epic is the wrong strategy. When you use a branch you are shifting focus to the issues you identify in the branch. The actions within the branch are taken against that issue. So the way your rule is written, you are Editing the field in the Epic, by having that Edit action in the branch that shifted focus to the Epic.

Remove the branch.

Instead, use just the Edit Issue action in the main line of the automation rule. You can use the COPY FROM option to edit the field and copy the value from the issue's parent Epic.

Screenshot 2024-12-02 at 10.12.14 AM.png

 

Screenshot 2024-12-02 at 10.12.24 AM.png

 

Screenshot 2024-12-02 at 10.12.33 AM.png

 

Screenshot 2024-12-02 at 10.12.44 AM.png

daniela zanini December 2, 2024

Hi Trudi Claspill,

I already try also this way, but seems that during the story creation, the epic link is not available. I try to log but seems that epic link is not filled.

thanks

Dany

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hello @daniela zanini 

Please show the Audit Log for the rule where you executed it in the manner I recommended and there was no information in the log for Epic Link. Also show the version of the rule that was used during that execution.

Are you setting the Epic Link when you create the issue using the Create button from the menu bar vs. the Create option from within the Epic?

I would also recommend that you add a Condition to your rule, perhaps after the Re-fetch action, to confirm that the triggering issue has an Epic specified:

Screenshot 2024-12-02 at 10.35.38 AM.png

0 votes
Shiva Kumar Hiremath
Contributor
December 2, 2024

Hello @daniela zanini ,

Please try by adding "Delay" before refetching the issue datadelay.png

 

 

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.
December 2, 2024

Hi @Shiva Kumar Hiremath 

The Delay() action would have no impact on the symptom / scenario the question describes, and...

The Delay() action is only available for Jira Cloud with the Premium and Enterprise license levels.  This question is for Jira Data Center.

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Delay

Kind regards,
Bill

0 votes
Harshit Grover
Contributor
December 2, 2024

Hi @daniela zanini ,

Steps through which you can create such rules : 

 

  • Trigger: Issue Created
  • Condition: If Issue Type is Story or Task
  • Condition: If "Epic Link" is not EMPTY (ensuring it’s a child of an Epic)
  • Action: Edit Issue (Set PID field value to {{issue.epic.PID}})

 

Regards, 

Harshit Grover

 

daniela zanini December 2, 2024

Hi Harshit Grover,
Thank you very much, but I do not have "Epic Link" available in the field condition.

I have also used the branch to view the epic and log the Epic Link value, but it cannot find it. Could this be due to the fact that the value has not yet been saved during the creation phase, and therefore the link cannot be established?

Do you have any other suggestions?

BR

Daniela

Suggest an answer

Log in or Sign up to answer