Hide specific issue types for certain users

Hide specific issue types for certain users

Problem

You need to restrict certain users from seeing specific issue types when creating issues. For example, you want to hide New Feature and Improvement from the issue types list when creating an issue if the user is not a project leader.

Solution

To achieve this, use the lfRestrictSelectOptions function, which hides these issue types for project leaders. The script operates independently of the screen (Create/Edit/Transition) to ensure consistent issue type visibility control. This prevents users from creating an issue and later changing its type through editing.

Script

string project = "TP"; //the project key string pm = projectPM(project); string[] forbiddenTypes = {"New Feature", "Improvement"}; //the array of the issue types to restrict if(pm != currentUser()) { lfRestrictSelectOptions("issueType", forbiddenTypes); }

Important: When using the lfRestrictSelectOptions function, always use quotes around the first parameter (for example, "issueType"). This ensures you're passing the field label name as a string value.

If you omit the quotes and write just issueType, SIL will try to retrieve the issueType value from the current issue. This causes the script to fail on the Create Issue screen because no issue exists yet to retrieve a value from.

Implementation steps

  1. Create the SIL script using the code provided above.

  2. Customize the script by replacing:

    • "TP" with your actual project key;

    • {"New Feature", "Improvement"} with the issue types you want to restrict.

  3. Save the script as restrict_issueTypes.sil.

  4. Associate the script with the primary Live Fields configuration on your project.

For more information, see the Configuring Live Fields page.

Example usage

This script automatically restricts issue type visibility based on user permissions. When a non-project leader tries to create an issue in project TP, they will not see New Feature and Improvement in the issue type dropdown.

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.