Error: The customfield `11406` was assigned to `value=2 - Medium class=java.lang.String`, but it should have been set to a custom field object

Originally asked by Mariia Horbatiuk on 04 December 2020 (original question)


Hi,

I have the following error:

Unexpected error occurred. The customfield `11406` was assigned to `value=2 - Medium class=java.lang.String`, but it should have been set to a custom field object


Answer by Mariia Horbatiuk on 04 December 2020

Hello,

This error might appear either in the Outgoing, when you assign a non Custom Field to replica.customFields:

replica.customFields."11406" = issue.fixVersions

The resolution there is not to use customFields but try to use the same field:

replica.fixVersions = issue.fixVersions

Or in the incoming when you do something similar when setting the custom field:

issue.customFields."11406" = "My value"

The resolution there is to add .value

issue.customFields."11406".value = "My value"

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.