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

Limit issue types based on user group

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
 // Note: You should run this script by selecting "On load" in the check box above.

const issueTypeField = getFieldById("issuetype")

const user = await makeRequest("/rest/api/2/myself");
const { accountId } = user.body;
const userGroups= await makeRequest("/rest/api/2/user/groups?accountId=" + accountId);
const groupNames = userGroups.body.map(({ name }) => name);

// Select the group that the specific issue types will be shown for. 
const group = "Developer";

if (groupNames.includes(group)) {
    issueTypeField.setOptionsVisibility(["10001", "10004"], true)
}
Having an issue with this script?
Report it here