Hi everybody,
In Jira 4.1.2, we used a groovy script and Atlassian API to update a single select list custom field value using this kind of code (cfCustomFieldDDL is the custom field object, adStd is the issue, "None" exist in the options list):
cfCustomFieldDDL.updateValue(null, adStd, new ModifiedValue(adStd.getCustomFieldValue(cfCustomFieldDDL), "None"), changeHolder);
This was effectively setting the selected item of the drop down list to "None". Now that we just upgrade to Jira 4.4.4, this dont work anymore because the customfieldvalue table (stringvalue field) now store the ID of the string, instead of the string itself. I tried to update the customfield with the ID of the string (supplied either as "12245" or 12245) but this dont work.
Please help, this is blocking for me!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It make sense, but script runner seems unable to load the requiered packages
import com.atlassian.jira.issue.customfields.option
import com.atlassian.jira.issue.customfields.manager
for the code:
OptionsManager optionsManager = ComponentAccessor.getOptionsManager(); Option oSTCouranteDDL = optionsManager.findByOptionId(new Long(12251)); cfSousTacheCouranteDDL.updateValue(null, adStd, new ModifiedValue(adStd.getCustomFieldValue(cfSousTacheCouranteDDL), oSTCouranteDDL), changeHolder);
I got these errors:
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script9.groovy: 10: unable to resolve class com.atlassian.jira.issue.customfields.manager
@ line 10, column 1.
import com.atlassian.jira.issue.customfields.manager
^
Script9.groovy: 9: unable to resolve class com.atlassian.jira.issue.customfields.option
@ line 9, column 1.
import com.atlassian.jira.issue.customfields.option
^
Script9.groovy: 75: unable to resolve class OptionsManager
@ line 75, column 16.
OptionsManager optionsManager = ComponentAccessor.getOptionsManager();
^
Script9.groovy: 76: unable to resolve class Option
@ line 76, column 8.
Option oSTCouranteDDL = optionsManager.findByOptionId(new Long(12251));
Did i miss something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.