Table of Contents |
---|
...
For the sake of this exercise we will consider that all subtasks need to be closed in order to let an issue to be closed.
Add a new condition
Log in as an administrator and navigate to Administration-> Workflows and edit "Close Issue" transition on the default your JIRA workflow.
Press `Add` "Add a new condition:" link.
Select (k) SIL Condition and then press Add.
Writing the SIL code
The page Add Parameters To Condition apprears. In the SIL code edit area insert the following code:
Code Block |
---|
// 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; |
The page should look like this:
It is recommended to give the program a easy identifiable name in the Name field, press CHECK to verify the code and then Add to save the condition.