Hi,
Could you please help me here?
I want do something based on a greater than/ less than comparison of the "number" part of an issue key and another number: if(comparison) do something, but I can't get it to work.
I set up a simple rule to debug this: a manual trigger and the audit log action to see the result of the smart value.
I can extract the number part of the issue key just fine (using the example issue ABCD-857):
issue.key.split('-').get(1) --> 857
The result also seems to be numeric and of the correct length:
issue.key.split('-').get(1).isNumeric() --> true
issue.key.split('-').get(1).length() --> 3
issue.key.split('-').get(1).equals("857") --> true
But I somehow cannot compare it in a way to use it within a condition.
Although using the math tag it works...
#=issue.key.split('-').get(1) <= 100 / --> 0
#=issue.key.split('-').get(1) >= 100 / --> 1
...I can't find a way to combine the #if and the math tag, if that is possible at all.
So I tried to use lt/gt, but none of them gave me any output, also no error.
issue.key.split('-').get(1).lt(100) -->
issue.key.split('-').get(1).lt("100") -->
issue.key.split('-').get(1).asNumber.gt(100) -->
issue.key.split('-').get(1).asNumber().gt(100) -->
gt/lt seem to work as intended when I already have a number:
issue.key.split("-").get(1).length.gt(2) --> true
I suspect I messed up in the string to number conversion step, but I'm out of ideas, I'm sure I just made a stupid mistake and would appreciate any pointers here, thanks!