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?