[英]JIRA Multi select checkbox customfield not getting updated properly
I have a transition screen from which I am getting values(s) via a checkbox control, I need to get these values and update them on another checkbox control in the issues view screen. 我有一个过渡屏幕,可以通过复选框控件从中获取值,我需要获取这些值并在问题视图屏幕中的另一个复选框控件上进行更新。 The below code updates the values but doesn't change the checkbox to checked. 以下代码更新了值,但未将复选框更改为选中状态。
platvalue = issue.getCustomFieldValue(platRelOnField) //platRelOnField is the field from where I am getting my values to be set , it has 3 options [High,Low,Medium]
ModifiedValue mVal = new ModifiedValue(issue.getCustomFieldValue(platRelOnAPIField),platvalue);
platRelOnAPIField.updateValue(null, issue, mVal, new DefaultIssueChangeHolder());
I am new to groovy/jira and cant seem to know the right way to set the checkbox options properly. 我是groovy / jira的新手,似乎无法知道正确设置复选框选项的正确方法。
Any help in the right direction is appreciated. 任何在正确方向上的帮助将不胜感激。
I am using JIRA 6.3.9 我正在使用JIRA 6.3.9
Managed to get it working by writing the below code 通过编写以下代码设法使其正常工作
ArrayList<LazyLoadedOption> optionsList = new ArrayList<LazyLoadedOption>();
FieldConfig fieldConfig = platRelOnAPIField.getRelevantConfig(issue);
OptionsManager optionManager = ComponentAccessor.getOptionsManager();
platOptions = optionManager.getOptions(fieldConfig);
for(def i = 0;i<platOptions.size();i++){
def optVal = platOptions.get(i).getValue();
if(platOptions.get(i).getValue().equals("custom field value")){
optionsList.add(platOptions.get(i));
break;
}
}
platRelOnAPIField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(platRelOnAPIField), optionsList),changeHolder)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.