I've just started playing around with automations, and most of what I'm trying to do is working really well, but I'm really struggling with what should be a really simple thing to do.
I need an automation that triggers when a value in a custom numeric field changes.
e.g. pseudocode:
if the value changes from below five to over 5 then
if the value changes to over 200 do X
else if the value changes to between 50 and 200 do Y
else if the vlaue changes to between 5 and 49 then do Z
I've been playing around with various things but nothing seems to work. Am I trying to do something overly complicated here, or missing something obvious?
Any ideas?
Hi @Douglas Hall Welcome to Atlassian Community!
Assuming you’re setting up this automation for an existing number custom field, here’s how you can configure it:
1. Create a new automation rule using the Field value changed trigger. Select the field you want to monitor and set the Change type to Any changes to the field value. Leave the For field blank to allow the rule to run for all operations.
2. Add an “If: smart value” condition to check if the field’s value changes from below 5 to 5 or higher. Use the following smart value:
{{and(fieldChange.toString.asNumber.gte(5),fieldChange.fromString.asNumber.lt(5))}}
3. Set up nested conditional logic using IF / ELSE: Add condition:
In the first IF block, check if the new value is greater than 200. If true, add the corresponding action.
Add a second IF block to check if the value is greater than 49. This covers cases where the value is between 50 and 199.
Finally, add an ELSE block without any condition. This will handle values between 5 and 49.
4. Save your automation. Once published, it should work as expected.
Hi @Douglas Hall -- Welcome to the Atlassian Community!
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
For the field value changed trigger, the {{changelog}} value may be used to check the previous and current values:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--
And so your initial check with the previous value:
{{#changelog.yourCustomField}}{{fromString}}{{/}}
Could check if it was below 5, and then check the current value if it is over 5 before proceeding.
Then use an if / else block for the various conditions for X, Y, and Z.
Kind regards,
Bill
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.