Restricting resolutions based on issue type

Restricting resolutions based on issue type


Required apps

Power Scripts™ for Jira (server)

Level: BASIC

Problem

We want to restrict the resolutions in the resolve issue screen according to the issue type.

For example, if issue type is New Feature or Improvement, we want to remove from the list of available resolutions the following ones: Fixed, Won't Fix, Cannot Reproduce.

Solution

All you have to do is to create the following script and associate it with the main Live Fields configuration on your project, as described here.

restrict_resolutions.sil
string[] issueTypes = {"New Feature", "Improvement"};
string[] bugResolutions = {"Fixed", "Won't Fix", "Cannot Reproduce"};
if(elementExists(issueTypes, issueType)) {
   lfRestrictSelectOptions("resolution", bugResolutions);
}

The above SIL™ script makes use of the lfRestrictSelectOptions routine offered by Power Scripts™ for Jira's Live Fields feature, which lets you restrict options to any field of type select list in Jira.

See also