Example scripts
To homepage
Jira

Limit issue types based on user group
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

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