Skip to main content
Skip table of contents

Writing expressions

You can always get autocompletion by typing Ctrl+Space if you are inside an input field.

How does it work?

When writing expressions, you can access and check various information available during the transition, for example, the transitioned issue, the project to which the issue belongs, or the user who is executing the transition.

You can access properties of these elements by using the . notation. For example, you can access the reporter of the issue with issue.reporter. Custom fields can be referenced by their id (issue.customfield_10143).

(info) A full overview of all possible types can be found in Atlassian's documentation.

Properties can be compared with other properties or fixed values using different comparison operators like ==!= or >.

You can combine different expressions with the logical operators && and || to check multiple expressions. Operations can also be surrounded by parentheses, which allows for more complex expressions.

On some elements, it is also possible to execute functions. These are based on the JavaScript syntax, so you can check whether a text includes another text or whether the issue contains a certain set of labels.

Give me some examples, please…

Check that the issue has an assignee:

CODE
issue.assignee != null

Check that the issue type is either Story or Task:

CODE
['Story', 'Task'].includes(issue.issueType.name)

Check that the summary of the issue starts with refined or approved regardless of capitalization:

CODE
issue.summary.toLowerCase().match('^refined|approved') != null'

Check that all subtasks are in a status of the category Done:

CODE
issue.subtasks.every(subtask => subtask.status.category.name == "Done")

Check that there is a value for custom field customfield_10046 if the resolution is Duplicate:

CODE
issue.resolution.name != "Duplicate" || (issue.customfield_10046 != null && issue.customfield_10046 != "")

Check that the issue is labeled with needs-refinement:

CODE
issue.labels.includes("needs-refinement")

Check that the issue was updated within the last five days:

CODE
issue.updated > new Date().minusDays(5)

Check that there exists at least one issue link of type Blocks:

CODE
issue.links.filter(link => link.type.name == "Blocks").length >= 1

Check that the assignee was changed in the transition screen (only for validators):

CODE
originalIssue.assignee != issue.assignee

Check that the user executing the transition has the project role Developers:

CODE
user.getProjectRoles(project).some(projectRole => projectRole.name == "Developers")

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.