Scriptrunner condition/validator to stop transition before the previous subtaks is done

Patricia Johansson April 8, 2024

Hi everyone,

The setup of the project is that we will have a task, with multiple subtask, all with a "phase number" (custom number field). I want to be able to set a condition that a subtask can't be set to In Progress before the previous phase has been done.

  1. If current ticket is the lowest phase (1) -> Transition OK
  2. If current ticket is NOT the lowest phase, but phase-1 is done -> Transition OK
  3. If current ticket is NOT the lowest phase and phase-1 is NOT done -> Block transition

Any ideas on how this can be done with scriptrunner in the workflow?

1 answer

1 vote
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

Hi @Patricia Johansson

I have a doubt to clarify, based on what condition do you determine if the previous phase is done or not?

I am looking forward to your feedback and clarification.

Thank you and Kind regards,
Ram

Patricia Johansson April 8, 2024

Hi Ram, thanks for your answer!

It would be based on the status = done or resolution.

Hope this clarifies

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

Hi Patricia, 

So let me try to understand your requirements a little bit more.

Say for example you have 2 subtasks. So you do not want to permit the 2nd subtask to transition to done unless the 1st subtask has already transitioned to done or resolution?

Is this correct?

Thank you and Kind regards,
Ram

Patricia Johansson April 8, 2024

Correct yes, only difference is that I don't want the second subtask to transition to "in progress" before the 1st subtaks is transitioned to done

The idea is to use the numbered field to identify the order (as the subtaks might not be created consecutively)

Patricia Johansson April 10, 2024

Hi @Ram Kumar Aravindakshan _Adaptavist_ 

I have this flowchart if it makes it more clear

image.png

Patricia Johansson April 12, 2024

Hi @Ram Kumar Aravindakshan _Adaptavist_ do you have any ideas if this is possible?

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2024

Hi @Patricia Johansson

I have been a busy these couple of days, so didn't have time to look into it.

I'll update you once I get some time and go through your previous comments.

Thank you and Kind regards,

Ram

Like Patricia Johansson likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events