Dear ALL,
in the Jira Automation Rule, given an "If block", is it possible to add more than one conditions?
I have added 2 conditions (which I know for sure they are both true) but the If block is NOT executed.
See please the attached screen-shot.
Do I do somthing wrong or this is a known limitation of Jira DC?
Is there by chance any workaround?
Thanks in advance,
Vincenzo.
Without seeing your entire rule or audit log details, it is difficult to diagnose this. Please post images of both of those. Thanks!
Until we see those...
How do you know both of those conditions are true? Did you try writing the values to the audit log to confirm the values before the conditions?
And...smart value lists use 0-based indexing:
Your {{issue.subtasks.get(2).status.name}} is comparing to the third subtask. Is that what you expected?
Kind regards,
Bill
Hi @Bill Sheboy,
that's correct: I know the 2 conditions are true because I print them in the audit log.
See please the details attached.
Yes, get(2) is comparing to the third sub-task, that's what I need in my rule.
It seems to me that really the "If block" doesn't work there are more than 1 condition.
Thanks in advance,
Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please note {{issue.subtasks.get(2).status.name}} contains "Closed" and you are comparing to "CLOSED", and so the comparisons do not match as they are case-sensitive.
You could either change the condition case to match, or better still, force the smart value to a known case by adding toUpperCase() at the end:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much @Bill Sheboy, I should have thought about that.
What about the case when the sub-task has been re-opened, I mean, what would it be the syntax to use in the "Second value"; see please the attached screen-shot:
which I have tried out but it didn't work.
Thanks, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When trying to match this way, the exact case must be used. Please look at example issues and your status configurations to match the names.
Again as an alternative, you could force the names to uppercase for comparisons:
{{issue.subtasks.get(2).status.name.toUpperCase()}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy.
Ok but then, how can I implement the "OR" condition within the If block?
So, the sub-task status name can be either Reopened OR Open.
Thanks for your help.
Kind Regards, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use separate conditions in the if / else block for each status name, or use a single logical expression with the OR operator: https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.