Hi everyone,
I’m attempting to conditionally create a dynamic label based on the value in a date field. Specifically, I’m parsing out the month to map it to a quarter. However, I can’t seem to get the equals function to resolve to true. It either resolves to false or throws an error and fails to resolve at all.
Right now I'm just writing log actions while I'm trying to get it to work.
In my testing, I’m using a September date. So, I should be able to compare it to some form of the number 9 and get it to resolve to true, but I can’t get it to work. Here are the permutations I’ve tried:
Parse the Date Field
Log action = "Target Start Month: {{issue.fields.Target Start.substring(5,7)}}, Year: {{issue.fields.Target Start.substring(0,4)}}"
Log - "Target Start Month: 09, Year: 2024"Parse the Date Field as Number
Log action = "Target Start Month: {{issue.fields.Target Start.substring(5,7).asNumber}}, Year: {{issue.fields.Target Start.substring(0,4)}}"
Log - "Target Start Month: 9, Year: 2024"Attempts to Compare Using the Equals Function
Resolves as FALSE
Resolves as: {{issue.fields.Target Start.substring(5,7).equals(09)}}
Resolves as: {{equals(issue.fields.Target Start.substring(5,7), 09)}}
Resolves as: {{equals(issue.fields.Target Start.substring(5,7).asNumber, 9)}}
Resolves as: {{equals(issue.fields.Target Start.substring(5,7).asNumber, 09)}}
Resolves as: {{equals(issue.fields.Target Start.substring(5,7).asNumber, '9')}}FAILS to Resolve
Resolves as: {{issue.fields.Target Start.substring(5,7).equals('09')}}
Resolves as: {{equals(issue.fields.Target Start.substring(5,7), '09')}}
Resolves as: {{equals(issue.fields.Target Start.substring(5,7).asNumber, '09')}}Any insights or suggestions on how to get this to work would be greatly appreciated!
Thanks in advance!