Hello Jira wizards, gurus, and everything in between!
I'm trying to set up an automation rule on a random chance (1:10) event that looks something like this:
When Issue transitions in workflow > Create Smart Value 1-10 > If Value = 1 then follow through else disregard.
Using the AI automation creator, it suggested the following formula:
Then: Create variable
Variable name: randomNumber
Smart value: {{math.randomInt(1,10)}}
If: Compare two values
First value: randomNumber (I have also tried {{randomNumber}} - Same results)
Condition: equals
Second value: 1
Then...
However, the rule is not triggering as intended (pronounced not triggering at all). For the purposes of testing, I've set the values in math.randomInt to (1,2) for a 50% chance but have failed consistently.
When checking the audit log, it shows every entry as No actions performed / condition not met.
Any help / suggestions on how to make this or any other effective RNG rulesets work would be greatly appreciated.
Thank you!
Hello @Daniel Shepperdson
Welcome to the Atlassian community.
Where did you find the information that "math.randomint()" is a valid function for Jira Cloud Automation? Based on the documentation, there is no such function.
Given that there is no such function, the variable will never be set to 1.
Also, an excellent debugging tool is to use the Log Action to print the actual values of fields, smart values, and variables into the rule execution Audit Log so you can confirm they have the values you expect.
Hi Trudy,
It was provided by the 'Create With AI' service as a smart value. On another attempt it also suggested {{#=}}{{random(10)}}{{/}} which failed in the same fashion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I recommend that you always verify information generated by AI by referencing the documentation.
The documentation reference I provided references only the following with regard to the use of a RANDOM function.
I don't appear to have access to the "Create with AI" feature in the instances to which I have access, so I can't comment specifically on that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the community. It will be great if you can actually provide us with your current automation rule details, so we can review and assist you further.
For the Smart value setup, it seem you are simply setting a local variable and populate it with some value within the automation rule right?
Please advise.
Best, Joseph Chung Yin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph,
I've added screenshots of where the rule breaks & the following action. The only prior step is "When issue is transitioned from <Status A> to <Status B>".
I've tried using {{randomNumber}} & randomNumber as the variable name for both Then: Create variable and If: Compare two values with the same results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the {{randomNumber}} value have since you use "Create with AI" smart value syntax?
Best, Joseph
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.