Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation Smart Value Help - 1 in 10 chance to trigger event

Daniel Shepperdson July 5, 2024

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! 

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

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.

Daniel Shepperdson July 10, 2024

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.

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.
July 10, 2024

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.

Screenshot 2024-07-10 at 4.03.20 PM.png

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.

0 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 5, 2024

@Daniel Shepperdson -

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

Daniel Shepperdson July 10, 2024

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.

 

image.pngimage.png

Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2024

@Daniel Shepperdson -

What is the {{randomNumber}} value have since you use "Create with AI" smart value syntax?  

Best, Joseph

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events