You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

As described in A general note about JWT for Jira Cloud, it is not possible to use the JWT parser in conditions or validators. So the JWT DC Logical condition is not available in JWT Cloud. Instead, the Jira expression condition can be used. The JWT parser expression has to be migrated to a Jira expression.

Create a Jira expression condition

Since the basic concept of JWT parser expressions is strictly different from Jira expressions, it is not possible to migrate them directly. We describe below the basics.

Field codes

Jira expression Field codes differ from the JWT ones, a list of corresponding field codes can be found in Field codes. They are offered in the field code injector of the parser expression editor of the Jira expression condition. For further details of Jira expression field codes please refer to Atlassian's documentation.

Operators

JWT DC
  

Jira expressionNotes
===
!=!=
<<
<=<=
>>
>=>=
~.includes()

Example:

issue.summary.includes("issue")
!~!...includes()

Example:

issue.summary.includes("issue")
IN

.every....includes()

Example:

issue?.subtasks?.every(s=>issue?.links?.map(link => link.linkedIssue.key).includes(s.key))
NOT IN ! every....includes()

Example:

!issue?.subtasks?.every(s=>issue?.links?.map(link => link.linkedIssue.key).includes(s.key))
ANY IN.some()....includes()

Example:

issue?.subtasks?.some(s=>issue?.links?.map(link => link.linkedIssue.key).includes(s.key))
NONE IN!....some()....includes()

Example:

!issue?.subtasks?.some(s=>issue?.links?.map(link => link.linkedIssue.key).includes(s.key))

Functions

Jira expression functions are based on the respective data type and are related to JavaScript notion. Details of the available functions can be found in Atlassian's documentation.

Examples

JWT DC use case

JWT DC parser expression

Jira expression
Make "Time spent" field required
{issue.timeSpent} > 0
issue?.timeSpent >0
Block an Epic's transition until all the issues under that Epic are resolved
%{issue.issueType} = "Epic" IMPLIES count(filterByResolution(issuesUnderEpic(), "")) = 0
issue?.issueType?.name == "Epic" ? issue?.stories?.every(s=>s.resolution != null) : true
issue?.isEpic ? issue?.stories?.every(s=>s.resolution!= null) : true
Block a transition until all sub-tasks have certain fields populated
count(filterByPredicate(subtasks(), {function.issue.dueDate} != null)) = count(subtasks())
issue?.subtasks?.every(i=>i.dueDate != null)

If you still have questions, feel free to refer to our support team.