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.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is exactly what I need!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.