Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Default value for the Resolution on workflow transition screens

Lakshmi CH
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.
January 17, 2023

Hi Team,

Is it possible to define a default value for the Resolution on workflow transition screens? We don't need automatic resolution through workflow post function. It should display the value on workflow transition screen. 'Resolved' would be the default, not "none" , and only for specific project workflow, not global.

We have script runner, JMWE, JSU addons.

Resolve.PNG

 

2 answers

2 accepted

2 votes
Answer accepted
Florian Bonniec
Community Champion
January 17, 2023

Hi @Lakshmi CH 

 

You can create a Scriptrunner Behaviour to do that, but having it as default may lead to people selecting the default value and not the appropriate one base on the context of the issue, so you will not be able to tell that 'Resolved' is actually resolved.

It may be something like that in a script in a behaviour initializer.

import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
 
if (getActionName() == "<TRansition NAme>") {
    getFieldById(RESOLUTION).setFormValue("Resolved")
}

Regards

0 votes
Answer accepted
Darryl Lee
Community Champion
January 17, 2023

Hi @Lakshmi CH -- it looks like this can be done with ScriptRunner Behaviors on Jira Server/Data Center, per @Manish V's answer here:

https://community.atlassian.com/t5/Jira-Software-questions/How-do-I-change-the-default-value-for-the-resolution-field-on/qaq-p/1065850#M84766

Lakshmi CH
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.
January 17, 2023

Thank you @Darryl Lee .

It worked using behaviors.

 

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(10900)  // Here 10900 is resolution id.
}

Suggest an answer

Log in or Sign up to answer