I have an automation rule that creates a smart value containing the difference in days between two dates. The difference is being stored in the smart value variable. I can see the value is correct because I'm storing the value in a comment on the issue the rule is running for.
In my example the difference in days is 15.
Next in my rule I'm checking if the difference is less than 8. I'm doing this using if: matches. Even though the value is 15 the if statement is still passing and updating an issue field with the correct value. It's as if the rule is not recognizing that the values are numeric.
Any ideas why the if statement is passing when it shouldn't!?
Hello @Neil Ingram
You have the correct answer - the smart value {{diff}} is not recognized as a number.
When you store a value in a Variable, it is stored as a string.
If you want to compare it as a number you need to use
{{diff.asNumber}}
Thanks Trudy. Just tried this and get the same result. Its still passing on the If statement when it should fail.
{{Diff}} contains 19 so the statement below should fail, but it doesn't.
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.
What was the change you made so that it started working?
Reviewing your initial images o see that you variable used a capital D in the Create Variable step. Smart values can be case sensitive so you would need to use a capital D everywhere you use the variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, capital D and also added .asNumber on the Create variable smart value, as you suggested. Thanks for the support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for confirming the solution.
If my guidance helped you solve your issue, please consider clicking the Accept Answer button for my Answer.
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.
FYI, above is not the answer. I couldn't attach images when submitting my question.
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.