I'm creating a variable in Global Automation "PriorityUp"
When: Value changes for Priority
{{#if ( and( exists(fieldChange.toString.match("P[0-5]")), not(exists(fieldChange.fromString.match("P[0-5]"))) ) ) }}UP{{/}}
The intent if new priority value is in P0,P1,P2,P3,P4,P5
and the old value is not in P0,P1,P2,P3,P4,P5 (for example if it was "2 - Critical"
then the variable would be set to UP
using log statements these have string values as I would expect
fieldChange.toString = ""P1"
fieldChange.fromString = "2 - Critical"
ChangeItemBean{fieldId='priority', field='priority', fieldType='null', from='11305', fromString='2 - Critical', to='10302', toString='P1'};
But these don't work, return null?
fieldChange.toString.match("P[0-5]"
fieldChange.fromString.match("P[0-5]")
what is the trick needed to make the match function work?
Hi @Wayne Bryan
For an automation question like this, context is important...
Please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
Is your {{#if()}} ... {{/}} expression inside of an iterator or issue-scoped, smart value expression? If so, the change log smart values will not be visible.
Next, some smart values do not work inside of functions. (I do not know the reason for this.) As you have already tested to confirm the toString and fromString values can be written to the audit log, a workaround could be to first save those with the Create Variable action, and then use the variables in your condition tests.
Again, seeing your rule will help confirm what is possible.
Kind regards,
Bill
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.