Hello,
I am trying to write updateValue function. But getting Class cast exception.
Script field failed on issue: OB-170508, field: Requirement Allocation
java.lang.ClassCastException: java.lang.String cannot be cast to com.atlassian.jira.issue.customfields.option.Option
at com.atlassian.jira.issue.customfields.impl.SelectCFType.getDbValueFromObject(SelectCFType.java:72)
at com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType.updateValue(AbstractSingleFieldType.java:151)
at com.atlassian.jira.issue.fields.ImmutableCustomField.updateValue(ImmutableCustomField.java:426)
at com.atlassian.jira.issue.fields.ImmutableCustomField.updateValue(ImmutableCustomField.java:396)
at com.atlassian.jira.issue.fields.OrderableField$updateValue.call(Unknown Source)
at Script3297.run(Script3297.groovy:209)
code is
for (Y in List1)
{
X.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(X).toString(), Y),changeHolder)
}
where: X is of type com.atlassian.jira.issue.fields.ImmutableCustomField
Y is of type java.lang.String
I am stuck with this updateValue function call. Tried many options but some or the other class cast exception is thrown during function call. if possible please provide some sample code for updateValue function.
Thanks in advance !
You can see many example in my article here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.