Ok, Friends, Seems like I've done this many times and it's super simple, but it's not working.
What I'm trying to do:
For a New Hire request, there is a checkbox field for each system/service that the new employee needs access to. A new issue should be created for every box that is checked (all in the same project, for now, and with the same issue type).
How I implemented the solution using Automation for Jira (now called "Project Automation"):
I set up one Else If condition using a JQL filter for each checkbox field value (not elegant, but couldn't find a way to do "For Each" so I could loop through the values); then I set up the "Create Issue" action to run for each match on a checkbox field value.
What's happening:
A single new issue is being created instead of one for each match. The audit log says everything ran successfully, so it's not because of an error condition.
So, what am I missing?
Note: By the way, I had to use the trigger of "When: Value changes for" because we are using ProForma and it doesn't actually set the field values until AFTER the issue has been created, so I couldn't use the trigger "On Create".
Hello @Trevan Householder_Isos-Tech-Consulting_
The problem is that you have used Else-If.
Only the first matching condition will result in a new issue being created.
When you use Else-If, the Else-If check is executed only if the previous check evaluated as "False". As soon as one of those conditions evaluates as True, the remaining Else-If conditions are not going to be evaluated.
You need to use simple If conditions for each checkbox rather than If / Else-If / Else-If / ...
@Trudy Claspill Thanks for your response! However, that hasn't been my experience, and that's not what the documentation says about how if-else conditions work, either:
https://support.atlassian.com/jira-software-cloud/docs/automation-conditions/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Trevan Householder_Isos-Tech-Consulting_
The referenced document says:
"The if block executes the specified actions within that block when all the set conditions are met. If the conditions are not met, the else blocks will be evaluated."
Else (and Else-IF) blocks are evaluated only if the preceding If block's conditions are not met.
I haven't built up automations with this logic to test the actual experience in JIRA, but my statements are about the based on the logic of If/Else blocks.
So, to prove this out, in the scenarios where only one issue is being created, for each of those
If none of the preceding conditions are being met and none of the subsequent conditions are resulting in a new issue when you think it should, that supports my statement about how If/Else-IF logic works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill Thanks for pointing that out. I'll dig deeper and report back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill You nailed it. Thanks for hanging in there with me until I "got it"! Works perfectly. Many thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for posting your final solution! It's always great to see how things ended up and not be left hanging on an interesting post.
In terms of performance - would this solution also work with branching?
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.