Hi,
In a comment I am testing conditional logic and when ready, I hopefully can use the condition when editing a field so it is only updated if the condition passes.
In the rule I create a variable to set the day difference between the old date and the new date. I current edit the field to have the new date set in another field. But I'd like it to only update the field if it is later than the current date. I am not given the option to add a tule condition, most likely because I alreday am in an If/else condition.
The variable does the following which works perfectly, where its name is called daysDifference.
{{issue.customfield_10109.diff(fieldChange.to.toDate).days}}
days diff - [{{daysDifference}}]
-
{{#if(daysDifference.gt(0))}}
>> Change the date to the new date.
{{/}}
The variable print gives the correct day difference, but i get nothing from the smart valu condition, even if the value is greater than 0.
Does anyone see what i'm doing wrong or missed in the condition please?
Thanks,
Aldo
I wonder...currently created variables are always text type, so perhaps the gt() does nothing on that value. Please try converting the variable with asNumber before performing the comparison inside of the condition:
{{#if(daysDifference.asNumber.gt(0))}}
>> Change the date to the new date.
{{/}}
If that does not help, please post images of your complete rule and the audit log details showing the rule execution. Those may provide context for the community to offer suggestions.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.