I'm trying to write a rule that triggers when an Issue transitions to a certain status, with a condition that includes if-else blocks. I'm stuck on the correct magic for the date logic in the condition, which looks like:
So if {{ now.isAfter("2019-12-01") }} is true, and if {{ now.isBefore("2020-02-28") }} then set field to XXX
When the rule triggers, the {{ now.isAfter("2019-12-01") }}, it tells me that the Issue did not match the condition.
Does anyone know how to get that expression can resolve to true? Tried using .toDate, .jiraDate, and a bunch of other things, to no avail.
thanks in advance!
Hi. I was trying to do the exact same thing. The smart value expression you posted (`now.isAfter("2020-05-10")`) actually gives a blank result, which is weird. Using toDate and the rest gave me errors.
There's an unwieldy expression that does work:
{{ now.isAfter(now.withYear(2020).withMonth(5).withDayOfMonth(10)) }}
This gives the desired result, but I think it's a bit of a hack, I'd think there's a less ugly way to do this.
Oh and: I posted this as a question on StackOverflow: https://stackoverflow.com/q/61782620/477453
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.