The JQL parsing mode, just like the Issue list mode, lets you define a target selection of issues. It is being used in Post functions and Automation actions, that allow you to create or updated multiple issues.
The output has to be a valid issue list as defined in the Data types section. The input must be a valid JQL query where you can also use field codes.
Additionally JWT expression parser functions can be used.
Example expressions
Parser expression | Description |
---|---|
type = Bug and project = %{issue.project.key} | This example returns a list of all Bugs in the same project as the current issue. |
issuetype = "%{issue.issueType}" AND project = "%{issue.project.name}" | This example returns a list of all issues in the same project and with the same issue type as the current issue. |
JQL queries in JWT
Write JQL queries as you would in the issue navigator. The main difference is, that field codes and the output of parser functions will be replaced with the corresponding values at runtime.
If field values are expected to have white spaces or JQL reserved words or characters, you should enclosed the field code in quotes (double or simple). Example: summary ~ "%{system.currentUser.displayName}"
will return issues with the current user's full name in the summary. As the full name can contain spaces, the field code was enclosed in double quotes.
Anyways, there is an exception to this general rule: when the field contains a comma-separated list of values, and you want to use it with the JQL operator IN. In those cases the field code should not be enclosed in double quotes, since you want the content of the field to be processed as a list of values, not as a single text value.
Example:
You have temporarily stored the issue keys of all linked issues in a Temporary text field. The field now contains a comma-separated list of the following issue keys: "CRM-1, HR-2, HR-3".
JQL query | JQL query after field code is replaced with values | Description |
---|---|---|
key in ("%{issue.temporaryText1}") | key in ("CRM-1, HR-2, HR-3") | This query will not return any results as it is syntactically incorrect. |
key in (%{issue.temporaryText1}) | key in (CRM-1, HR-2, HR-3) | This query will return all issues stored in the temporary field. |
Disable JQL syntax pre-checks
When a JQL query is being entered, a syntax pre-check is performed in order to verify that the query is syntactically correct. When field codes are being used, however, the final query that will be executed is unknown, since it depends on the actual values of the fields in runtime.
In these cases the syntax pre-check is done with speculative values assigned to the fields, which might break the syntax check.
In order to inhibit the JQL syntax pre-check simply add //
to the beginning of the query. Those characters will be removed once the actual JQL query will be executed.
// key in (%{issue.key})
Make sure to read all about working with Lists as they come with many extremely useful JWT expression parser functions.
List functions can also be used in the Advanced text mode. The difference is, that the output will be a flat text instead of an issue list.
The main advantage over the advanced text mode is, that you can use the returned elements of the issue list as Seeds.
If you still have questions, feel free to refer to our support team.