/
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. Follow these steps:

  1. Create the script provided below.

  2. Associate the script with the primary Live Fields configuration on your project. For more information, go to Configuring Live Fields.

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.

restrict_issueTypes.sil
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); }

 

Make sure to use quotes for the first parameter when using the lfRestrictSelectOptions function (for example, "issueType") to correctly pass the field label name for the current screen.

Otherwise, SIL™ retrieves the issueType from the current issue and fails on the Create Issue screen because the issue is not yet created.

 

 

Related content