Multiple automation rules when creating an issue - define sequence?
Asked by Simon Sahli:

Dear community,

we are having multiple automation rules in that get triggered when an issue is created in a JSM project.  
There is one huge "customer cascade" rule that fills data for several fields after a customer has created a new ticket.   
Then there are other automation rule, which are based on the data of this first automation rule.  

Today the problem is that all automation rules directly run, whenever a new issue is created, which can be a problem, since some automations are depended on the first automation rule, when it comes to certain data. So there execution is not correct, since they are missing data at the point of execution. Meaning they should run AFTER the foundation "customer cascade" automation rule is completed.  

What is best practice for the automation rules for such a use-case?  
Is it possible to have a delay for running the automation rules after the issue creation?  

If "issue creation" is not possible to use as a trigger then I thought about creating a "scheduled" rule that will be run twice a day or so would be a suitable solution.  
This would work, but if the data can be updated in almost real time then this would be preferable.  

Thanks in advance for your input!  
Simon


Answers:
author: Vishal
body: Hi [@Simon Sahli](/t5/user/viewprofilepage/user-id/5214924)

You mentioned **Then there are other automation rule, which are based on the data of this first automation rule.** So, why don't you run the second set automation based on the f**ield value changed** trigger rather than **issue created** trigger ?

This should help unless there are some more complex automation \& which are interconnected.

Hope it works.

comments: author: Simon Sahli
body: I could, but the problem is that these fields can be changed afterwards as well manually and then I don?t want that the "second create" rule gets trigger and overwriting the manually changed field values.  

<br />

I think I might use the suggestion from John Funk below to write a label with a specific value, which then triggers the second job and at the end the label gets deleted.  
That is similar to your idea, just that this one ONLY gets triggered from the first create rule, since it will be a very specific value.


author: Vishal
body: Hi [@Simon Sahli](/t5/user/viewprofilepage/user-id/5214924) sure that would work. Otherwise you can also try out the suggestion in this kb **[How to simulate a delay/sleep function in the automation](https://confluence.atlassian.com/jirakb/how-to-simulate-a-delay-sleep-function-in-the-automation-1141489822.html)**

Hope it helps.


author: Simon Sahli
body: Thanks [@Vishal](/t5/user/viewprofilepage/user-id/3505998) , this is indeed an interesting suggstion.   
I anyway wanted to look into the webhook part and now there is a potential use-case!


author: John Funk
body: Hi Simon,

You are not really going to be able to control that outside of setting a value of a hidden field in the first rule, and then have the second rule fire based on the value of the hidden field changing. And so on.

comments: author: Simon Sahli
body: Thanks, I have heard of this.   
So basically you add a specific value to, for example to the label field, and then this label value triggers the other automation rule, right?  

In the second rule I could then delete the label that the first automation rule has created, right?  
So I don?t have unnecessary label values in the system...  


author: John Funk
body: Yes, that will work as well. But labels are harder to deal with. A simple radio button with yes/no options works really well. And just hide the field from the screen.


author: Simon Sahli
body: Hi [@John Funk](/t5/user/viewprofilepage/user-id/7148) ,  
thanks, then I know that the radio button solution is the simpler way of getting to a solution!


Tags: automation

cloud

jira-service-management

jira-service-management-cloud