I’m trying to create an automation rule for moving issues to done once they’ve been approved by all parties. The one I created works well for the most part, but if there’s multiple approvers on a task, it doesn’t wait for everyone to respond--say that another person and I are approvers. If only I approve the issue, it’ll go straight to the approved status without input from anyone else.
It should be noted that my company doesn’t use Jira Service Management (and based on what little I know about JSM and what this rule will be used for, I don’t think that would benefit us). We use Jira Software.
I created a custom field called “Approval Status” and used the trigger When: Value Changes and added conditions for it to transition to different statuses depending on what was selected. I tried adding an Advanced Compare Values to the If/Else section, but nothing really worked (doesn’t matter how much I learn about them, I don’t think I’ll ever wrap my head around Smart Values lol).
So, does anyone have any suggestions on how to fix this so that the issue doesn’t transition before all approvers respond?
Great question.
I think I've got something that may work for you.
First, you'll need two custom fields
Let's say you have a status called "Waiting for Approval". On that status, create a new transition that goes from Waiting for Approval -> Waiting for approval.
On the transition, set a condition that only users in the custom field you created can execute the transition. You'll also want a transition for Rejecting the approval. You can just make that one go to the status that a rejected ticket would go to. Once again, add a condition so it can only be done by users in the approvers field.
Once you have those two, you'll want to create a 3rd transition from your "waiting for approval" status -> Change request approved. On this status, set a condition to "hide" the transition from the user.
Now we'll get into the automation rule. Basically what we will do is increment our "Approval count" each time the "Approval" transition is executed. After every increase to the field, we re-fetch the issue data and check to see if we have the same number of approvals as people in our list. If so, transition it to the "approved" status.
My automation rule just uses some dummy statuses, but you can just update it with your values and it should work no problems.
Hi @Kian Stack Mumo Systems. Thank you so much for this. The workflow part has been working, but so far I haven't gotten the automation to work in my favor. I'm thinking what I want is too complex for Jira automation and that I'm going to need an add-on :/ Oh well. Thank you again for your help though, I really appreciate it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which part isn't working?
Thanks,
Kian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, the “Edit issue Fields: Approval Count” doesn’t actually wait for multiple people to respond. It just, er, changes whatever number was in the status on the issue? Like if I had a 1 there, the number would increase to 2. I tried multiple combinations and I keep getting the same result (besides when I added >=1, but even then, it wasn’t really waiting as more of it just wasn’t changing the value).
I can get the status to transition to “Approved” … even if I pick the “Rejected” approval status. Nothing I do can get it to move to “Not Accepted”. I even tried splitting them up so that there’d be an accepted rule and a rejected rule, but it still wouldn’t move and said there was an error. And if I try to make a rule with both aspects included, it just doesn’t transition to anything whatsoever!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Christian Bellmore,
I'm not sure I understand.
This is what my workflow looks like:
The "Rejected" and "Approve" transitions can only be executed by the users that have been selected as the approvers, meaning that other users cannot execute the transition.
The transition "Approved" can only be executed using Rest API or an Automation rule (such as the one I showed above).
Let's break down the automation rule step by step:
Can you please provide some clarification about what isn't working for you? It worked just fine for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for going more in depth with the automation. The Edit Approval Count step is happening, but it's not what I want. I didn't want that part to update the count, hence why I was so confused about it before. The fourth step seems to finally be working though. But it's still not transitioning to any status no matter what I do. I don't know why; my workflow and automation are the same as yours. It's just... not working for some reason.
Oh well, I think this is as good as it's going to get. I know I keep saying this, but seriously, thank you for all your help. I really appreciate it :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Christian Bellmore I think you want to attack this from the Workflow instead of Automation. If you take a look at the approval step in your workflow, you should be able to set "number of approvers" and select which statuses to transition to for Approved/Declined.
Let me know if this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bailey Hecksel. I think that's only available in JSM. This is what it looks like when I tired to set that in my workflow. I tried the out of box status to see if that made a difference, but it didn't make a difference :/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow, I think you're right. That seems incredibly silly to me.
If JSW and JSM projects can utilize the same (global) workflows, why is it not available in JSW?
Sorry for any confusion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't worry about it. I appreciate the help either way :) And yes I agree, it doesn't make sense that this isn't an option in JSW! I hope Atlassian adds it someday
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.