Info | ||
---|---|---|
| ||
This feature is available for the Jira server deployment option only. We plan to add it to the Cloud version in the near future. |
Conditions control who can perform a transition and the circumstances under which they can perform this transition. If any part of a transition's condition fails, the user will not see the transition link on the 'view issue' page.
You can use JJupin and SIL Power Scripts™ for Jira and SIL™ to define a large set of conditions beside Jira's built-in conditions, by just adding a (k) SIL SIL™ Condition to the transition and publishing the workflow, as described here.
Below are just a few The following common examples explain this feature:
Table of Contents |
---|
Info | ||||
---|---|---|---|---|
|
| |||
Power Scripts™ for Jira (server) Level: BASIC |
Previous status
A workflow condition that allows enables you to disable a particular transition if the current issue has never been in a specific status:
...
Code Block | ||
---|---|---|
| ||
number STATUS_OPEN = 1; string[] status_history = fieldHistory(key, "status"); string previous_status = getElement(status_history, size(status_history)-3); return previous_status == STATUS_OPEN; |
Cascading select comparer
A workflow condition that allows you to disable a particular transition when two cascading selects are equals:
...
Code Block | ||
---|---|---|
| ||
//Condition Cascading select comparer if(length(customfield_10000) == 0 && length(customfield_10001) == 0) { //both cascading select are empty return true; } if(customfield_10000 == customfield_10001) { return true; } return false; |
Condition based on regular expression
A workflow condition that allows you to disable a particular transition when a custom field value doesn't match to a regular expression:
...
Code Block | ||
---|---|---|
| ||
//Condition based on regular expression return matches(Combo, "accepted(.)(\\\\d+\\\\.?){10}(.)[a-z]+(-)(\\\\d+\\\\.?)"); |
Condition based on linked issues
A workflow condition that allows you to disable a particular transition when the current issue has no linked issues:
Code Block | ||
---|---|---|
| ||
//Condition on linked issues return size(linkedIssues(key)) > 0; |
Condition on non-linked issue
A workflow condition that allows you to disable a particular transition when the current issue has linked issues:
...
More details can be found on Math Routinesroutines section.
Condition based on date-time expression
...
More useful date routines can be found in the Date Routines section.
Compare two parsed texts
A SIL condition which checks if description contains summary:
Code Block | ||
---|---|---|
| ||
return description.contains(description, summary); |
Except assignee Condition
...
Where customfield_11300 and customfield_11301 are JIRA Jira custom fields of type numeric.
...
The transition won't be shown unless all sub-tasks are resolved. You can also specify a particular resolution that the sub-tasks must be in (in our example Fixed):
Code Block |
---|
string[] subtasks = subtasks(key); for(string subtask in subtasks) { if(%subtask%.status != "Resolved" || %subtask%.resolution != "Fixed") { return false; } } |