Status still shows if we add the condition "Block transition until approval"
Asked by Santhosh Raj:

I still have the same issue. I have set the workflow with All(Can be moved to any status).  
But for the approvals in JSM. ![Screenshot 2024-03-18 151734.png](/t5/image/serverpage/image-id/312651iA5F0BA78F5987B1F/image-size/large?v=v2&px=999 "Screenshot 2024-03-18 151734.png")

We have like 2 approvals set it up and other status to open.  
But when the request is created, user can move to any stages without the approval process.  

I have also used the process "Block transition until approval", but that is also not working. Again I can move the status to another without doing approvals.   

<br />

What we need is, if the request is not getting approved, it should not transition even it is in All stage.


Answers:
author: Rebekka Heilmann _viadee_
body: Hi [@Santhosh Raj](/t5/user/viewprofilepage/user-id/5283233)

can you post a screenshot of your whole workflow?

If I understand correctly, you allow transitioning from all status into all except for the approval part.

The system behaviour is correct in that the pending approval doesn't stop other configured transitions from being executed. There are actually several use cases for it:

For instance, a customer could cancel or resolve the request before it's been approved in cases where the request has resolved itself. Or the approval takes so long that the customer (or automation) escalates the issue after a while.

You therefore would have to change the "all" transitions to single arrows between the statues OR add conditions to the all statuses -\> aside from "Block transition until approval" you could try "Previous status condition".

However from my understanding, "Block transition until approval" should do the trick. Maybe it's missing somewhere?

comments: author: Santhosh Raj
body: ![Screenshot 2024-03-18 162025.png](https://community.atlassian.com/t5/image/serverpage/image-id/312665i78E0758169C6FF78/image-size/large?v=v2&px=999 "Screenshot 2024-03-18 162025.png")

![Screenshot 2024-03-18 162223.png](https://community.atlassian.com/t5/image/serverpage/image-id/312666i8AFE5D7B4ED4CCE5/image-size/large?v=v2&px=999 "Screenshot 2024-03-18 162223.png")

Also we have set it up the condition. I updated the "Block transition Approval for all Stages" But it still shows list.

![Screenshot 2024-03-18 162436.png](https://community.atlassian.com/t5/image/serverpage/image-id/312667i98C715EA01CA59B4/image-size/large?v=v2&px=999 "Screenshot 2024-03-18 162436.png")

So let me know what needs to be done.  
Cannot be done in arrow since it will take multiple line and the workflow view will be messed up   

So need some help and urgent ? [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395)


author: Rebekka Heilmann _viadee_
body: [@Santhosh Raj](/t5/user/viewprofilepage/user-id/5283233)

according to this: [\[JSDSERVER-6467\] Make the "Block transition until approval" condition work for any transition in the workflow - Create and track feature requests for Atlassian products.](https://jira.atlassian.com/browse/JSDSERVER-6467)

the condition only works for the transitions connected to the approval step. It's a feature request for server but it sounds like it's the same in cloud.

So maybe try to change the condition to

Previous state condition and check for "Waiting for HR Head".


author: Santhosh Raj
body: I haven't tried the "Previous state condition"  
But when I updated for To do and Applications, its not showing in the status transition.  
Also if it comes forwarded, does it go backward also for any statuses.  

Please explain me how to update the "Previous state condition" how it work ?

[@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395)


author: Rebekka Heilmann _viadee_
body: I don't understand the question.

I thought, the only thing you want to prevent is to jump to any status before the issue has been approved. Once it's approved, the condition is true (the issue definitely has been in the Status "Waiting for HR Head") and the transition "all" is available from any status.

So at all "All" transitions you need to add the Previous state condition (checking if the issue has ever been in the state and delete the "pending approval" condition.

The only thing you then need to make sure is that you cannot transition back from the Joined/Rejected State as I guess these are final? You can do that also with the "previous state condition" by reversing it.

![Screenshot 2024-03-18 132522.png](https://community.atlassian.com/t5/image/serverpage/image-id/312687iBB82B62025613081/image-size/large?v=v2&px=999 "Screenshot 2024-03-18 132522.png")


author: Santhosh Raj
body: Our expectations are  

When a request in the issue type, it should not be directly moved to the stages from   
"To do --------\> Joined, Blocked, but can be rejected.  

For example :  
If it comes under "Waiting for Business Head" no one should move it to the above stages or should not list the other stages.  

But once it comes to To do Status, Now it should be in ALL stage and it can be moved from To do ------\> Joined anywhere as they want except Reject/Withdraw or Approvals.  

Now help me with the situation.  

And please explain in a short summary, how "Previous state condition" works ? [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395)


author: Rebekka Heilmann _viadee_
body: I already told you what you need to do. Either set up workflow conditions for all your transitions or swap from the "All" transition to single arrows.
> So at all "All" transitions you need to add the Previous state condition (checking if the issue has ever been in the state and delete the "pending approval" condition.

In your case, you need to check for the status "Waiting for HR Head".

"Previous state condition" checks whether the issue has been in the specified status at any point in time or as the current status. The transition will only available to the user if the condition is true (or false if reversed).

This is all I can say to your question without accessing your site and configuring it myself. You could always find an [Atlassian Partner](https://partnerdirectory.atlassian.com/) nearby and ask them for assistance. Also, there are courses available at the Atlassian University for building Workflows.


author: Santhosh Raj
body: Thanks [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395)   

I got it cleared and now it worked.   


Tags: cloud

jira-service-management

jira-service-management-cloud