Forums

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

Script post function update field

Daniel Wellington February 26, 2019

Hi, I'm trying to work out why the below script isn't working. I'm trying to update two custom fields as part of a post function:

 

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.issue.customfields.manager.OptionsManager

 

def optionsManager = ComponentAccessor.getComponent(OptionsManager)

def customFieldManager = ComponentAccessor.getCustomFieldManager()

 

def scrapCf = customFieldManager.getCustomFieldObjectByName("Country")

def fieldConfig = scrapCf.getRelevantConfig(issue)

def option = optionsManager.getOptions(fieldConfig).getOptionForValue("UK", null)

issue.setCustomFieldValue(scrapCf, option)

 

def scrapCf = customFieldManager.getCustomFieldObjectByName("City")

def fieldConfig = scrapCf.getRelevantConfig(issue)

def option = optionsManager.getOptions(fieldConfig).getOptionForValue("London", null)

issue.setCustomFieldValue(scrapCf, option)

 

checkAttachment = {attachment -> false};

issue.assigneeId = null;

 

1 answer

0 votes
Jiri Kanicky April 10, 2020

What are the custom fields? Checkboxes or list fields?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events