Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

How to use placeholders for JQL in JSU

Atlassian's Jira Query Language (JQL) allows you to do some perform advanced searching in Jira's search dialog. This is a very powerful feature provided by Atlassian in Jira. JSU extends JQL with additional placeholders, which will be are replaced with the values of the current issue in transition.

...

Code Block
titleConfiguration in JSU
parent = {issue.Parent} AND component != {issue.Component/s} OR component is EMPTY 

it will be changed converted by JSU into something like this, before the search is executed similar to the following:

Code Block
titleValues after replacement
parent = 'ABC-123' AND component != 'Documentation' OR component is EMPTY 

...

Any text in curly brackets, which follows the pattern {issue.FIELD NAME} will be is replaced with the value of that field on the current issue (the issue in transition). See bellow below for further details what on which names you can use for the different field types. Depending on your use case, you might not use any {issue.FIELD NAME} placeholder at all.

Logical operators, functions, Functions and operators are the same as the JQL in JIRAJira. It is important to use the correct JQL syntax. The easiest way to write a JQL query for JSU is to prepare it first in Jira's standard search interface (use 'advanced search'!) with some sample value. Then , then copy it to JSU configuration and replace some of your sample values with {issue.FIELD NAME} as required.

See JQL Use Cases for more examples.

Anchor
toptips
toptips

...

Our tips for using JQL with JSU

Fields on the current issue

...

Fields on the parent issue

Add the following to your JQL query:

Code Block
... AND key = {issue.parent}

Fields on all sibling issues (other sub-tasks of the same parent issue)

Add the following to your JQL query:

Code Block
... AND parent = {issue.parent} AND key != {issue.key}

...

See JQL Use Cases for more examples.

Think carefully about

...

your query results

JQL in JSU can be very powerful. However, you also must think very careful, carefully about what values might be used as replacement replacements for the {issue.FIELD NAME} placeholders. Or what happens, if an issue has no value on such in a specified field. There could be quite some variety variation in the data of your issues.

(warning) If you are not careful, the result of such a JQL query might unexpectedly might contain hundreds of issueissues. Or, the JQL query might fail , because the syntax has become invalid after the placeholders had have been replaced.

Anchor
maxAllowed
maxAllowed
Maximum

...

issues allowed

You can set a limit for the maximum number of issues you expect from your JQL query (see also previous paragraph). If the result of the JQL query returns more issues, JSU will not process anything. JSU is pulling the emergency brake essentially stops the process before things get out of control.

Like this This way, you can prevent JSU from accidentally processing hundreds of issueissues. By default, this limit is 50 . You cannot set any higher limit than 1000issues, and the maximum limit is 1,000.

JQL

...

injection

(warning) Further you must be  Be aware of potential 'JQL injection':
. JSU does not check any value which that it retrieves from the current issue. A malicious user might craft the value of a field (for example the value of a text field) , so that after the replacement it adds an additional criteria to your JQL query.

(info) We We recommend that you do not to use any text fields as placeholders. Or , or any other field , of for which the a user can freely change the text. Only use fields which that can contain one/several of clearly defined values.

Syntax for

...

field names

Field names in your JQL should be the same as in the Advanced Search. We suggest to use using the issue navigator's auto-complete feature to get the correct field names. In Jira's top menu bar, go to Issues > Search for issues, and switch to Advanced search.

System

...

fields

System Fields field names should be the same as those used in JQL. For example:

  • reporter
  • assignee
  • issuetype
  • priority
    etc.

Custom

...

fields

Custom Fields field names also should be the same as those used in JQL. For example:

  • Approver or  cf[10010]
  • Hosting Server or cf[12910]
  • Date to Join or cf[11000]
    etc.

(info) If you have several custom fields with the same name, you can only use the cf[12345] notation to refer to one of them.

Syntax for

...

values of the current

...

issue

Replaceable The replaceable value from the issue must be between curly brackets like:

{issue.FIELD NAME}

System

...

fields

Use the place holders from the following list:

  • {issue.Affects Version/s}
  • {issue.Assignee}
  • {issue.Affects Version/s}
  • {issue.Assignee}
  • {issue.Component/s}
  • {issue.Created}
  • {issue.Creator}
  • {issue.Customer Request Type}
  • {issue.Description}
  • {isseu.Due Date}
  • {issue.Environment}
  • {issue.Epic Color}
  • {issue.Epic Name}
  • {issue.Epic Status}
  • {issue.Epic Link}
  • {issue.Fix Version/s}
  • {issue.Issue Key}
  • {issue.Issue Type}
  • {issue.Labels}
  • {issue.Original story points}
  • {issue.Parent}
  • {issue.Priority}
  • {issue.Project}
  • {issue.Rank}
  • {issue.Reporter}
  • {issue.Request participants}
  • {issue.Resolution}
  • {issue.Resolved}
  • {issue.Security Level}
  • {issue.Sprint}
  • {issue.Status}
  • {issue.Summary}
  • {issue.Time to resolution}
  • {issue.Updated}
  • {issue.Voters}
  • {issue.Watchers}
  • {issue.Work Ratio}

Alternatively, you might use the technical field id ID of a system field, or how JQL is referring refers to it. For example all those 3 variant , all three variants below refer to the same field:

  • {issue.Affects Version/s}
    Label in the english English Jira user interface.
  • {issue.versions}
    Technical field idID. See also the constant values reference from Atlassian.
  • {issue.affectedVersion}
    JQL's way method to refer to that field.

Custom

...

fields

You can use either the name of a custom field , or it's idor its ID. For example:

  • {issue.My Text Field}
  • {issue.customfield_12345}

...

(info) If you have several custom fields with the same name, you must use the custom field idID.