Forums

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

updateValue function gives java.lang.ClassCastException

Sujatha May 23, 2018

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 !

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2018

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events