JQL Use Cases

 

JSU includes a JQL Condition and JQL Precondition. We've also integrated JQL in many of our workflow post functions, allowing Jira administrators to set wider parameters that can be fully customized. Below, you will find a few examples of how flexible and powerful JQL can be when used with JSU.

Refer to the JQL Reference for details on how to use JQL with JSU.

JQL Conditions

Is Issue in current sprint?
1 Sprint in openSprints() AND key = {issue.key}
In the IT department only the approver can perform the transition
1 approver = currentUser() OR component != "IT department"

Or in other words: The condition is valid if the current user is the user in the approver field OR anything not belonging to the IT department. 

All other sibilings must have status
1 parent = {issue.parent} AND key != {issue.key} AND status in (Resolved, Closed)

With parent = {issue.parent} we find all siblings of the current sub-task. However we want to exclude the current sub-tasks, so we add key != {issue.key}.

JQL Precondition

With workflow preconditions for post functions, you can limit in which cases a JSU post function is performed. 

Check if Testing Sub-Task already exists
1 parent = {issue.key} AND issuetype = "Testing Sub-Task"

With parent = {issue.key} we retrieve all sub-tasks of the current issue in transition. We then refine this to a particular sub-task type with AND issuetype = "Testing Sub-Task".

For example, you might create the "Testing Sub-Task" with the Create a Linked Issue post function, but only if it does not yet exist:

JQL in post functions

In several JSU post functions, you can specify a JQL query to retrieve the issues that will be modified by the post function. See also Related Issues.

Update description of particular sibling issues

Transition: Resolve in "Testing Sub-Task" Workflow 

Copy fields from template issue

Let's say we have an issue XY-23, which we are using as a 'template'. The issue is hidden in a project that is viewable only to Jira admins and has pre-configured values on several fields.

Change status of critical issues in epic

If there are critical and blocker issues in an epic that are still in the open state, change it to In Progress status.