Is there a way to set the default resolution value for a project?

Jack Kelly
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2015

I'm looking for a way to set the default value for the resolution field in a project. It looks like it defaults to the first item in the list and I am wondering if I can change that so it defaults to a different value in the list.

3 answers

1 accepted

2 votes
Answer accepted
GabrielleJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2015

Yes. In your Workflow's final transition (assuming it's the Resolve or Close transtion), there will be a post-function that sets the resolution field or add one if there's none. Update that with your desired value.

4 votes
Andrey Glazkov January 23, 2020
  1. Install Scriptrunner add-on on your Jira.
  2. Go to Administer panel, Add-ons tab, Behaviour menu.
  3. Add Behaviour.
  4. Click to Fields.
  5. Click to Create initialiser and paste following code to form (suppose that desired default resolution value = Done)
    import com.atlassian.jira.component.ComponentAccessor
    import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION

    def constantsManager = ComponentAccessor.constantsManager
    def defaultValue = constantsManager.resolutions.find { it.name == 'Done' }
    getFieldById(RESOLUTION).setFormValue(defaultValue.id)
  6. Map behaviour to desired projects and issue types.

 

default_resolution.PNG

ChrisR April 15, 2020

Thank you, I think this will work for us!

Matt Moody May 19, 2021

This worked exactly the way I needed it to for initializing the resolution for a specific project to Done but leaving the default alone for all other projects.  Thanks.

2 votes
Jeremy Gaudet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2015

Not really; I assume you are limiting the list using transition properties, or else you'd pick up the system default.  I have JRA-45531 filed as a suggestion for them to add a property to also specify the default in the same context.

As Gabrielle says, you can set it explicitly, but I assume what you were asking about was the default selection in the pick list.

Jack Kelly
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2015

Yes I was asking about a field value default for the project. But Gabrielle's solution works just as well for my situation as I'm trying to minimize what our Service Desk staff have to touch and the resolution our customers should always see is Done not Fixed. I could have used the System-wide resolutions values to choose a different default for all projects, but that may bother developers like me that may typically like the default set Fixed.

Michael Kornatzki
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2015

It is really simple to include with Scriptrunners Behaviour Plugin (with an own Script). I added a new transition-property 'resolution.default' and now i can set the default resolution for every transition.

ChrisR December 8, 2015

This is what I am looking for! Do you have a sample of code you could show as to how you set the default value inside your different transitions?

ChrisR December 9, 2015

no, I want to see a default value on the transition screen so that the user can leave or change the value. The post functions are exactly that.... post.

Peter Lang March 15, 2017

This is exactly what I need!!

Suggest an answer

Log in or Sign up to answer