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

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

How do I change the default value for the resolution field on the resolve issue screen?

Right now the default value for the Resolution field on my Resolve Issue screen is set to "Done." How do I change that to default to a different resolution value? 

Note: The "Resolution" field is NOT a custom field. 

6 answers

1 vote

Not quite what you are looking for, but rather than changing the default, you could use some of the instructions here to manipulate the list available.

Optionally, if you have the Scriptrunner add-on (and you are running on server) you can use a Behavior script to change the default value for just the context that matters to you.

To expand on the "scriptrunner" option, here is a post from just yesterday that explains how to do that:

https://community.atlassian.com/t5/Marketplace-Apps-questions/Set-default-field-value-to-nothing/qaq-p/1066726

Hello Katherine,

I found the solution to the issue here-
https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Set-default-field-value-to-nothing/qaq-p/1066726

(Not sure whether you need the solution  now as that has been more than an year since the question was posted but you can surely use that for reference)

You'll need the scriptrunner plugin to implement the same.

Steps-

1) Go to the section "Behaviors"
2) Create a new Behavior
3) Add Mapping (Select the project and issue type)
4) Select the "Fields" option in the behavior
5) Here, you'll need to select "Resolution" in the add field option
6) Map to a Workflow
7) In the added field, select "Add Condition" and select "Workflow Action" and select the name of the transition.
8) Save and click on "Add Server Side script"
9) Add the following script-

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

if (getAction() != null) {
def constantsManager = ComponentAccessor.constantsManager
def Map resolutionMap = [ null: "Please select" ]

constantsManager.resolutions.inject(
resolutionMap
) {
map, resolution ->
map[resolution.id] = resolution.name
return map
}

def resolutionField = getFieldById(RESOLUTION)

resolutionField.setFieldOptions(resolutionMap)
resolutionField.setFormValue(null)
}


(As mentioned in https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Set-default-field-value-to-nothing/qaq-p/1066726 )

 In the bottom
"resolutionField.setFormValue(null)"
add the ID of the resolution, which you would like to have shown as the default resolution, in the place of "null"
eg: "resolutionField.setFormValue(1234)"

10) Save and check

Please let me know if you need more if or have any queries.

Best Regards,
Manish

Thanks to all who responded. It doesn't really solve my problem, but I just removed the screen and added a post function to change the resolution for that specific transition. 

We actually implemented a "resolution code" custom field where I can set a different list of values and default for a different context. That's the field the users use.

The actual system resolution field is never visible for most projects and is set/unset by the workflow.

John Funk Community Leader Apr 25, 2019

Can you be more specific about the problem then? What additional functionality are you looking for that the transition doesn't provide?

I want to set the default value for the Resolution field on a specific screen I created for a specific transition. I don't want the default to be the same for the Resolution field across all screens and transitions. 

For example:

1. I have one transition from Ready to QA to Closed and the transition text is "Won't Do". I want this transition when selected to open a screen with the Resolution field and the Assignee field with a Comments field. I want the Resolution field to default to "Won't Do" and the Assignee field to default to "Unassigned." I still need the Comments field, so just adding a Post function doesn't give me what I want. So what I did was add the post function and then created a screen where just the comments show. This is sufficient, but not exactly what I was wanting. I wanted the transparency of seeing what value the Resolution field and Assignee field were going to be changed to.

2. I have other statuses that also transitioned to Closed, but I want these to open a screen where the Resolution field defaults to "Done" because work was actually completed. These are find how I have them and work the way I want. It's just #1 above I was having a hard time figuring out. 

John Funk Community Leader Apr 26, 2019

Would you actually be able to change the value for the Resolution? Or would it must be for showing the value that is going to be saved?

I don't think we would change it, it's mostly for transparency. I don't think it would matter if it could be changed. As long as it defaulted to Won't Do on this specific screen. 

John Funk Community Leader Apr 26, 2019

Why don't you simply label the transition name with Won't Do. Then there is no doubt what it is and you don't have to add the field to the transition screen.  :-)

Like Mikael Sandberg likes this

I did that and that shows and works in the old view, but with the new view Atlassian just pushed out, the transition names do not show...it just says "Transition to".  :o|

John Funk Community Leader Apr 26, 2019

If you actually edit the name of the transition, it should only show that. If you leave it as the default when the transition was created, then it will say Transition to:. Try to edit and simply say Won't Do and see what it looks like.  :-)

0 votes
John Funk Community Leader Apr 24, 2019

Hey Katherine,

Your workflow will have a transition to Done. Add a post function to the transition to Update issue field (not Update issue custom field). Then select the Resolution issue field and then select whichever value you want from the field value drop down. 

If you have two different transitions that should have different Resolutions, I would recommend removing the field from the screen and instead use a post function to set the resolution.

0 votes

Hello,

Go to cog item -> Issues -> Resolution and choose the default value.

I only want to change the Resolution default on one screen, not on all screens that use the Resolution field. If I change it under Issues > Resolution, it will change the default on all my screens that use this field. I have one transition to Closed that changes the resolution to "Done" and another one that changes the resolution to "Won't Do." So I created two screens for each scenario.  I want one screen to default to "Done" and the other screen to default to "Won't Do."

Is it possible to just change the default for my individual resolution screens?

If you are on server then you could use either the Power Scripts  or ScriptRunner apps.

If you want to use the Power Scripts app, then you could use the LIve Fields feature with a code like this:

lfSet("resolution", "your value");

Here is more info about Live Fields:

https://confluence.cprime.io/display/JJUPIN/Live+Fields

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

506 views 16 17
Read article

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