Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic State Transition

harshit29dx May 2, 2021

I need a workflow, where in I need 3 approvals and after the 3rd approval is attained, it should move to next state. Eg

 

Approval 1 -> Approval 2 -> Approval 3 -> Ready 

Once Approval 3 has reached it should automatically move to Ready state. How can this be achieved efficiently.

2 answers

1 accepted

0 votes
Answer accepted
Dirk Ronsmans
Community Champion
May 2, 2021

Hi @harshit29dx and welcome!

those 3 approvals would they need to be in a sequence or just 3 people that need to approve and then it can go to the next state?

Just 3 people is the easy one and you can just add them to the approvers field, configure a status with an approval step and have it move to the next step on approved. 

if a sequence is required and you don’t want to use an additional app you’ll have to use 3 statussen or even more complex a status that will transition to itself until a number is reached (using some automation tool)

harshit29dx May 2, 2021

Hey @Dirk Ronsmans yes it just needs to be 3 people who will click on approval 1/2/3 in no particular order. But once the person has clicked on approval 3, it should reach Ready state. 

 

Also, approval 1 /2/3 are independent states of the workflow. 

harshit29dx May 2, 2021

We don;t have approvers field but they are state as the approvers can be dynamic and depends on the day of approval so we want it to be a state.

Dirk Ronsmans
Community Champion
May 2, 2021

@harshit29dx ,

Let me first ask a question to what product you are using. I'm assuming you are using Jira Service Management ?

If so there should be a default system field called approvers but you can use another field.

By default, JSM has a concept of approvals built-in.

This below link will explain it in detail on how to set up the approval step itself.

https://confluence.atlassian.com/adminjiraserver/configuring-jira-service-management-approvals-938847527.html

What it essentially means is that you have a status in your flow (or multiple) where the process will hold until 1 or multiple users (that is configurable) give their approval. (the nice thing is also that these approvers could be customers and thus not require a license)

I believe in your case the easiest set up would be to have

  • a single status in your workflow configured as an approval step.
  • add the 3 users to your source field (where will the approval step get it's approvers) and you could even set these to a default value. (it does not have to be the default approvers field)
  • Also then configure the approval step to only go forward when all approvers have accepted
  • and choose which state to go when approver/rejected (this is part of the set up)
harshit29dx May 3, 2021

Screenshot 2021-02-10 at 2.01.35 PM.png

I want something of this sort. The thing is approval need not always come from a person it can be an automates state transition also. but once I reach approval 3, it should automatically transition to APPROVED state. I am planning to automate a flow and according to that I will pick all the tickets in APPROVED state.

Dirk Ronsmans
Community Champion
May 3, 2021

So looking at this you do want a sequence of approvals.

While it might not be my preferred way of working you can easily do this using JSM by simply setting up each approval status as an approval step  (see my previous reply with the link).

If 1 is approved you'd simply go to 2 and then 3. and approved (or rejected somewhere along the way).

Easiest here would indeed to put 3 different approver custom fields too so you can define who needs to approve in which step.

To automate a step you will need to take a look at an automation to transition the issue immediately based on some kind of condition.

harshit29dx May 3, 2021

Ok so If I understand you correctly, using JSM each of the three approval status will have an approval step associated with it. So if Approval 1 is approved we go to approval 2, if not it will go to rejected. same for approval 2. and for approval 3 if its approved it will automatically go to Approved state?

Dirk Ronsmans
Community Champion
May 3, 2021

Correct.

This way does limit you a bit in that you can only go to the 2nd person when the first has approved but that also helps as in that you don't bother the 2nd person when the 1st already rejected.

If you however want to send it to all 3 at the same time and want the system to wait till all 3 have approved (or one has rejected) you could just use a single step and configure it with multiple approvers.

But from your use case I feel like 3 statuses seems more what you are going for.

If in the future you are looking for a more flow based approval process, there are several apps available to take that out of the regular flow.

harshit29dx May 3, 2021

Noted on your pointers. As for the flow is concerned, I am not very strict on how the order is, just need to ensure 3 approvals are there before the person can proceed. 

harshit29dx May 3, 2021

Thanks @Dirk Ronsmans for your help.

Dirk Ronsmans
Community Champion
May 3, 2021

Well if the sequence really is of no value than I'd simplify your flow to just a single "Pending Approval" status and add the 3 users as Approvers.

You can then configure the Approval step on that status to require "all approvals"

It will simplify your flow and not get you locked in on always having 3 steps.

Like harshit29dx likes this
harshit29dx May 3, 2021

yeah sounds great, let me explore on this.

0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2021

Hi @harshit29dx 

If you always have 3 approval stages then create 3 user group fields for those 3 stages. Then add a condition using "user is in group picker" field. If you have ScriptRunner then you can add a custom script condition based on any field to check for approvers (like user picker field). What I also prefer doing is to add an approval date field to keep track of when approval was give. This approach can work only when you have limited number of approvals.

I hope it helps.

Ravi

Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2021

..and I forgot to mention if you have ScriptRunner then you can use "Fast-track transition an issue [ScriptRunner]" on your last approval transition to move the issue to the next status.

Suggest an answer

Log in or Sign up to answer