Forums

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

Prevent workflow transition if a related issue is not in the status "Done"

Paulo Renato Lara S. Rodrigues
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 30, 2019

Hi you all

I´m very new of the tool Jira and the Add On Script Runner.

I would like to know if someone passes through this same issue that I have and could please enlight me on this

I have this specific situation:

For each Story that we will develop we have a specific Issue Types for each phase of the Story, for example:

Story X (Related to Issue Type below)
----- Issue Type Development A (Related to Story X)
----- Issue Type Tests B (Related to Story X)

But on Workflow of the status "To Do" -> "In Progress" from Issue Tests (B), I need validate if the Issue Development (A) is in the status "Done",
if don´t I need to block this transition.

We have the Script Runner Plugin in my company, so I think it could be resolved with the Script Runner AddOn

Ao I add Validator in the workflow of Issue Type Tests, in a transition "To Do" -> "In Progress" (Add Validator To Transition)

Select Script Validator [ScriptRunner], and select Simple scripted validator

Here I will input a validation that could be like this:

Declare a variable
Boolean passesCondition = true

1 - Get the issue Story X related to the actual issue that is transiting (Issue Type Tests B);
2 - With the Issue Story in hand I need to get the issue type Development A (related to the same Story X);
3 - With the Issue Type Development A I need to check if the Status is "Done" (.getStatus().getName().contains("Done"))
4 - If the status of Issue Type Development is "Done" I will return passesCondition, otherwise If this is in another status (like "In Progress"), I put passesCondition = false and return passesCondition

Anyone could give me a help on this, please?

1 answer

0 votes
Pedro Suzuki January 31, 2019

Hi folks,

I'm with a similar issue, it's being hard to deal with Script Runner. 

Could anyone give us a hand?

Regards,

Suggest an answer

Log in or Sign up to answer