Automation to update epic when issue is created

SParker April 24, 2020

Hello all,

I am trying to use the automate feature within Jira cloud to do some conditional operations when an issue is created.  I want to check the description field to see if a couple different values are found.  If one of the values is located, then to assign the appropriate epic to that issue.  I am having no luck and can't see to get the update to occur even though the JQL that I have comes back with the match I expect.  Below is a section of the automation that I am using.  I have three sections that are identical except for the description value and the epic link they correspond to.

Any help would be greatly appreciated.

image.png

Close up of the Edit issue fields section:image.png

2 answers

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
April 29, 2020

Hi @SParker ,

Below worked on my classic Jira project. Instead of "If issue matches: JQL", I used "Issue fields condition"

Screen Shot 2020-04-29 at 23.12.56.png

SParker April 30, 2020

I tried that as well and it didn't work either. :( I am now working with the instance admin to check all the permissions to see if something is off for the Role Actor.

Mehmet A _Bloompeak_
Atlassian Partner
May 1, 2020

@SParker What error is logged in the audit log?

SParker May 18, 2020

Sorry for the late response.  There are no errors at all.  It is that the entire rule isn't firing all the time.  If I make it a global rule, it fires sometimes in other projects, but never for the one I want.  

I see that it is firing on some issues, but they are not consistent and never apply the rule as intended. I am attaching a screenshot of what I am seeing in the log.

 tempsnip.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.
May 18, 2020

Hi @SParker 

Something I found helpful to resolve rule issues was to add tracing statements to my rule, and then remove them later after I fixed things.  You can add comments to find out what values are being used, or use the Log Action or {{Debug}} statements.

https://support.atlassian.com/jira-software-cloud/docs/debug-a-rule/

Best regards,

Bill

SParker May 18, 2020

Update:  Thanks @Bill Sheboy  for the advice.  I used that to help narrow things down and make sure what was working and not.  I found that all of my logic steps are working as intended.  The part that is not working is the trigger.  For some reason, using the "When Issue Created" trigger doesn't work.  I am using the standard event and nothing custom.

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 18, 2020

Hi @SParker ... the audit log you provided indicates the trigger worked, as there would be no entry otherwise.  The issue is in the condition not being meet to proceed.

I have learned two key things in my short time working with the automation rules:

  • rules fire in a non-deterministic order, and
  • you cannot rely about a prior action completing *when* a trigger catches an event.

To mitigate those things, I have found a need to sometimes immediately re-fetch the issue before I do anything.  This can reload data which changed after the trigger fired. 

Consider adding a re-fetch action after your trigger and before your first condition test. As an alternative, maybe log all the values you would have tested in conditions before the condition statements.  That will isolate if the values are expected before the condition is/is not met.

Best regards,

Bill

Like Rich Steenwyk likes this
Rich Steenwyk August 24, 2020

The suggested "re-fetch" issue data worked in my case of automation triggered on issue create, but the issue data at the time of trigger didn't know it had an Epic linked yet (despite being created under one on the board).   After a "re-fetch issue data" action, the triggered new issue behaved as expected.

Like Bill Sheboy likes this
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.
August 24, 2020

Hi  @Rich Steenwyk  I am glad to hear that helped.

As the folks working on the rules have noted to the community, they are constrained by what the API makes accessible to the rules engine.  There appear to be race track conditions to improve in this area to help consumers with rule execution reliability.

Best regards,

Bill

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, 2020

Hi @SParker 

Is this a classic or next-gen project?  I recall seeing somewhere that the Epic Link field is no longer used for next-gen projects to manage the parent/child linking.

If this is a classic project, you may want to put in a support ticket as I think what you are trying should work.

Best regards,

Bill

SParker April 27, 2020

Thanks for the response Bill.  I am in a classic project.  I will contact Atlassian and see what they have to say about this and if I am doing something wrong.

 

Thanks

Vladimir Tarusov April 27, 2020

@SParker could you please return with feedback later? I'm also wonder why is this happening. Trying  "Epic Name" field but it doesn't work too.

Like SParker likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events