Skip to end of banner
Go to start of banner

Limit transitions based on the status of dependent issues

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Problem

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

Solution

You can add a SIL™ condition on the Close transition, which verifies the status of all dependent issues (child and linked issues). If any of the dependent issues is not already closed, the condition returns a false response.

Determine which dependent issues can limit transition

In this example, all subtasks must be closed before an issue can be closed.

Add a new condition

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

Edit the Close Issue transition of 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.

It is recommended to 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.

Table of Contents

  • No labels