The Adaptavist Group LogoDocumentation

Workflow Restriction Examples

You can control the visibility of workflow transitions using Jira expressions. This page provides examples specific to Restrict using a Jira expression (ScriptRunner) rule, where a transition button is hidden from users until the expression returns true. For more expressions that work for both restrictions and validators, see Workflow Restriction and Validator Expression Examples.

Only show the transition to specific user groups

Restrict visibility of this transition so that only users in certain groups can see or use it; for example, limiting it to administrators, developers, or a combination of specific roles.

// Single user group:
user.groups.includes('jira-administrators')
 
// Multiple user groups (user must be in at least one):
user.groups.some(g =>
  ['jira-administrators', 'developers', 'project-managers'].includes(g)
)
 
// Multiple user groups (user must be in all of them):
['jira-administrators', 'developers'].every(group =>
  user.groups.includes(group)
)

Only show the transition when the priority is High

Make this transition available only for high‑priority work items, such as those with a High or Highest priority, so it's reserved for the most important work.

// Exact priority match:
issue.priority.name == 'High'
 
// Multiple priorities:
['High', 'Highest'].includes(issue.priority.name)
 
// Priority High or above (High and Highest):
issue.priority.name == 'High' || issue.priority.name == 'Highest'

Only show the transition when an assignee is set

Ensure this transition can only be used when the work item has an assignee, optionally requiring that the assignee is the current user or belongs to a specific group.

// Assignee must be set:
issue.assignee != null
 
// Assignee must be set AND be the current user:
issue.assignee != null &&
issue.assignee.accountId == user.accountId
 
// Assignee must be set AND be in a specific group:
issue.assignee != null &&
issue.assignee.groups.some(g => g == 'developers')

Search documentation

Start typing to search the docs.