/
Limit transitions based on the status of dependent issues

Limit transitions based on the status of dependent issues

Problem

An issue can be closed while dependent issues, such as child or linked issues, are still open.

Solution

To address this, you can implement a SIL™ condition on the Close transition. This condition checks the status of all related issues (both child and linked issues). If any of these issues is still open, the condition will return a false response.

Identify restricting dependent issues

In this example, it's necessary to have all subtasks closed before closing the main issue.

Add a new condition

Log in as an administrator and go to Administration > Workflows.

Edit the Close Issue transition in your Jira workflow.

 

On the Conditions tab, click Add.

Select (k) SIL Condition and then click Add.

The Add Parameters To Condition page is displayed.

Writing the SIL™ code

In the SIL™ code editor, enter the following code:

// get all subtasks string s_tasks=subtasks(key); // process each subtask for(string s in s_tasks) // if subtasks' status is not closed the transition cannot be available and therefore return false if(%s%.status != "Closed") return false; // if not failed yet then the transition should be available return true;

In the Name field, enter a name for your new program.

Choose a name that is easy to identify.

Click CHECK to verify the code, and then click Add to save the condition.

Next, publish your workflow.

For more information on activating workflows, go to the dedicated section in the Atlassian Documentation.

Related content

Limit possible resolutions based on issue type
Limit possible resolutions based on issue type
Read with this
Restrict workflow based on status of dependencies
Restrict workflow based on status of dependencies
More like this
Limit the number of characters in a text-entry field
Limit the number of characters in a text-entry field
Read with this
Move parent and child issues together in the workflow
Move parent and child issues together in the workflow
More like this
Track completion progress
Track completion progress
Read with this
Block 'Close' Transition Until All Subtasks are Closed
Block 'Close' Transition Until All Subtasks are Closed
More like this