Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I have an existing groovy script that creates issues, however I cannot seem to figure out how to set a value of a KCF pro field. It seems to require the value to be in com.keplerrominfo.jira.plugins.keplercf.pro.optionscf.customfield.SocOptionImpl, however that class is not being exported. Is there a trick to be able to get and set the value from these fields?
I have a hack in place right now, where I create the issue with groovy, then have a SIL listener on the create event that copies the value from another field.
I tried porting over my groovy script to SIL a while back, however there were a few functions missing in SIL that prevented me from doing so. So for now I am stuck with groovy.
That was actually the first thing I tried. But when passing the value as string.
'{"label":"","value":"10000"}' I get an error:
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection
at com.keplerrominfo.jira.plugins.keplercf.pro.optionscf.customfield.SILOptionsCFtype.valuesEqual(SILOptionsCFtype.java:60)
at com.atlassian.jira.issue.fields.CustomFieldImpl.valuesEqual(CustomFieldImpl.java:1601)
at com.atlassian.jira.issue.fields.CustomFieldImpl.updateValue(CustomFieldImpl.java:462)
at com.atlassian.jira.issue.fields.CustomFieldImpl.updateValue(CustomFieldImpl.java:434)
at com.atlassian.jira.issue.managers.DefaultIssueManager.updateFieldValues(DefaultIssueManager.java:704)
at com.atlassian.jira.issue.managers.DefaultIssueManager.updateIssue(DefaultIssueManager.java:669)
at com.atlassian.jira.issue.managers.DefaultIssueManager.updateIssue(DefaultIssueManager.java:655)
at com.atlassian.jira.issue.IssueManager$updateIssue$0.call(Unknown Source)
at Script221.run(Script221.groovy:39)
When I pass it [label:"",value:"10000"] I get:
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.util.Collection
at com.keplerrominfo.jira.plugins.keplercf.pro.optionscf.customfield.SILOptionsCFtype.valuesEqual(SILOptionsCFtype.java:60)
at com.atlassian.jira.issue.fields.CustomFieldImpl.valuesEqual(CustomFieldImpl.java:1601)
and when I pass it [[label:"",value:"10000"]] i get:
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.keplerrominfo.jira.plugins.keplercf.pro.optionscf.customfield.SocOption
at com.keplerrominfo.jira.plugins.keplercf.pro.optionscf.customfield.SILOptionsCFtype.convertTypeToDbValue(SILOptionsCFtype.java:60)
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.convertTypesToDbObjects(AbstractMultiCFType.java:190)
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.updateValue(AbstractMultiCFType.java:142)
at com.keplerrominfo.jira.plugins.keplercf.pro.optionscf.customfield.SILOptionsCFtype.updateValue(SILOptionsCFtype.java:304)
at com.keplerrominfo.jira.plugins.keplercf.pro.optionscf.customfield.SILOptionsCFtype.updateValue(SILOptionsCFtype.java:60)
at com.atlassian.jira.issue.fields.CustomFieldImpl.updateValue(CustomFieldImpl.java:464)
the ouput of a getCustomFieldValue where it's already set gives me:
[SocOptionImpl{label='', value='25002'}]
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.