Want to Display the Select list With Value on WorkFlow Transition Screen

Kumar
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 9, 2019

Hi Team,

I have a Select List Field in that I have 5 Values. So, here I set the Default Value for that Select List Field.

I created a Screen and I added that Select List field to that Screen and I added that Screen on WorkFlow Transition.

When I click on that Transition Button a screen is popping up with the Field But it's not Showing the Default Value.

 I added that Field to the Create screen Then only that Field Showing with the Default Value that I have set.

 

Here I need that Field with that default value only when the issue moves to  particular status.

I have tried workflow post-function "Issue Field Update" in that I have only system fields.

Can anyone please suggest me how to achieve this.

 

Thanks,

Kumar

 

 

1 answer

1 accepted

1 vote
Answer accepted
Taranjeet Singh
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2019

@Kumar See if the solution in this article helps. You will need a third-party plugin (JIRA Suite Utilities) for this in JIRA Server: https://community.atlassian.com/t5/Jira-questions/Can-I-Update-custom-fields-thorough-a-transition/qaq-p/298697

Kumar
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, 2019

Hi @Taranjeet Singh  Thanks For Your response

 

Here I have used a "Behaviour Plugin" to make make field Value default so it will make the the Field value Default on Every Screen where ever the field is added

Here is the script the

import com.atlassian.jira.component.ComponentAccessor

// set a select list value -- also same for radio buttons
def faveFruitFld = getFieldByName("customfieldName")  // add you field name
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(faveFruitFld.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionToSelect = options.find { it.value == "abcdefg" }  // Feild value that you want to make default
faveFruitFld.setFormValue(optionToSelect.optionId)

 

Thanks,

Kumar

Suggest an answer

Log in or Sign up to answer