I have automation to create new tickets every time a sprint is created and it works great. Now I would like to automate the creation of a ticket every other (well, in my case, every third) sprint.
I tried to use an If block based on the sprint.id smart value like this:
{{sprint.id}} % 3
equals
0
but it doesn't trigger. I tried hardcoding "9 % 3" and it still doesn't trigger. So I'm thinking math doesn't work in that field.
Is there a way to accomplish what I'm hoping to do? I've seen regular expressions that try to do modulo calculations and they aren't pretty, but I do see that the When: Sprint Created block has a regular expression filter that could work.
@David Brown I built a rule to debug this for you. I ask the user to enter an "ID", then calculate the modulo 3 value. If it equals to zero, then I write a log message to the audit log.
This works as expected:
If you look at the "If" block you can see what expression I used. You can probably rework yours based on this.
Thank you for this very informative answer! As I'm sure you can tell I'm relatively new to Jira automation and completely missed the {{#=}} for math expressions. I also didn't realize there was a way to log to the audit log. You've opened a whole new world to me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Happy to hear that it was useful!
Yea, writing to the log is a great way to "debug" an automation rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Every other sprint isn't too bad:
Sprint [0-9]*[0,2,4,6,8]$
but every third sprint?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.