Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


How to restrict Resolutions the example script from script runner does not work.


Using Jira 8.13.1 Server

I have a project where the use wants to restrict the number of Resolutions available. The total list of Resolutions available are over 25. This is too many,

So one project wants to restrict this for all issue types. The workflow has 8 statuses and they allow any status to transition to any other status.

I copied the script from the scriptrunner website and changed it but for some reason this is not working on the view Issue. It only works when i am in the Edit ticket screen.
This is strange because Create, View and Edit are all the same screen.

I have the following script:

import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION

def constantsManager = ComponentAccessor.getConstantsManager()
def allowedResolutions = constantsManager.getResolutionObjects().findAll { in ["Won't Fix", "Incomplete", "Cannot Reproduce"]
    }.collectEntries {

3 answers

2 accepted

0 votes
Answer accepted
Daniel Ebers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 05, 2021

Hi @ChristopherChilds

maybe I am missing the advantages of Script Runner for doing this particular job - but have you had a look into workflow properties?
They also can be used to restrict which resolution is offered in a specific workflow:

I seem to understand you have several transitions in a likely complex workflow but what Taranjeet says is true from my view also - the setting should only apply to transition screens leading to a done/close status.
So, you would have to evaluate if this alternative approach using workflow properties work better over the Behaviours implementation.


Hello, @ChristopherChilds this code is set on Behavior right? In this case, the code cannot be applied on the View screen as documented here 

One alternative can be to remove this to the Edit screen, which avoids this field to be edited on the View screen, and add a resolution screen on Closing transitions

Thanks for the update. Can you just clarify what you mean by "remove this to the Edit screen"? The project uses the same screen for Create, Edit and View

Hi, @ChristopherChilds just create a copy of the screen, remove the resolution field and associate the new screen with the Edit operation on Screen Scheme. This guide can help you do this task if you need it. 

Taranjeet Singh
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 25, 2021

I think what @Fabio Oliveira Silva means to say is that the new screen (without the Resolution field) should be associated to the Edit Issue operation in the Screen Schemes for all issue types in the project. This won't allow Resolution to be editable, even from the View issue screen. The Resolution will be displayed on View Issue screen though.

Also, as @Fabio Oliveira Silva suggested, you should keep the Resolution field editable only on transition screens leading to Done or Closed statuses.

Hi, @ChristopherChilds, I also used the same code in behaviors for restricting resolutions. It worked fine with Jira-8. Now we upgraded to Jira-9 and it complains: in ["Won't Fix", "Incomplete", "Cannot Reproduce"] - is not existing any more

constantsManager.getResolutionObjects() - is no more available 

Do you have any suggestions how to overcome this problem?

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events