Example scripts
To homepage
Jira

Change the visibility of the priority field
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

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