It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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.

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.

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.

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.

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?

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.

This is exactly what I need!!

  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

Thank you, I think this will work for us!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,652 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you