Versions Compared

Key

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


Section


Column


Excerpt

Context variables (as mentioned in Jira expressions official documentation) are available depending on the context in which the Jira expression is evaluated. JMWE makes the issue, transition and user variables available to Jira expressions.



Column
width400px


Panel
borderColorsilver
bgColor#f5f5f5
borderWidth1
borderStylesolid

On this page:

Table of Contents



...

The user variable is used to insert information about the current user, i.e. the user triggering the transition. You can access the current user information under "Current User" section in the "Global Variables" tab of the Jira expressions editor. Click on a button to insert the expression into the editor.

You can also find the properties and methods of the user variable from the "Data Types" tab by selecting "User" under "Select a Data type".

...

user.accountId returns the accountId of the user triggering the transition, e.g. accountId:5ca5b1469a000c1180956957

user.groups returns the list of names for all the groups the current user belongs to.

user.groups.includes("jira-users") returns true if the current user is a member of the "jira-users" group.

user.getProjectRoles(issue.project) returns the list of project roles the current user belongs to in the issue's project

user.getProjectRoles(new Project("TEST")) returns the list of project roles the current user belongs to in the project with key TEST

user.getProjectRoles(issue.project).some(pr => pr.name == "Developers") returns true if the current user is a member of the "Developers" project role in the issue's project.

Note

The groups and getProjectRoles(project) methods are applicable to Jira Standard Single-User picker type fields (like Assignee, Reporter, etc) only. They are not applicable to custom fields of Single-User picker type. This is because Jira expressions don't return "real" user objects for custom fields