Skip to main content
Example scripts
arrow icon
To homepage
Jira
Cloud icon
Cloud

Change the visibility of the priority field

Features
Behaviours
Created 1 year ago, Updated 1 month(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira
Language |
typescript
const user = await makeRequest("/rest/api/2/myself");

const { accountId } = user.body;

const getUserGroups = await makeRequest(`/rest/api/2/user/groups?accountId=${accountId}`);

const groupNames = getUserGroups.body.map(({ name }) => name);

// Select group for priority field to be displayed
 const group = "administrators";

if (!groupNames.includes(group)) {
  getFieldById("priority").setVisible(false);
}
Having an issue with this script?
Report it here