Bumping back since even support seems unable to find what is wrong here.
Here’s a number of attemps:
Case 1 - following support’s suggestion with the code:
issue.customFields."Region".value = nodeHelper.getOption(replica.customFields."Region - BUE".value)
issue.customFields."Product Line - Tax&AMC".value = nodeHelper.getOption(replica.customFields."Product line - Tax&AMC - BUE".value)
The error is:
No signature of method: jcloudnode.services.jcloud.hubobjects.NodeHelper.getOption() is applicable for argument types: (com.exalate.basic.domain.hubobject.v1.BasicHubOption) values: [BasicHubOption{id='37898341721617', value=italy_bue, sequence='null', disabled='null'}] Possible solutions: getOption(com.exalate.api.domain.hubobject.v1_17.IHubIssue, java.lang.Long, java.lang.String), getOption(com.exalate.api.domain.hubobject.v1_17.IHubIssue, java.lang.String, java.lang.String), getOption(com.exalate.api.domain.hubobject.v1_17.IHubIssue, java.lang.Long, java.lang.String, boolean), getOption(com.exalate.api.domain.hubobject.v1_17.IHubIssue, java.lang.String, java.lang.String, boolean), getOptions(com.exalate.api.domain.hubobject.v1_17.IHubIssue, java.lang.Long, java.util.List), getOptions(com.exalate.api.domain.hubobject.v1_17.IHubIssue, java.lang.String, java.util.List)
Case 2 - While with the code:
issue.customFields."Region".value = replica.customFields."Region - BUE".value
issue.customFields."Product Line - Tax&AMC".value = replica.customFields."Product line - Tax&AMC - BUE".value
The error is:
Could not create an work item with type `Service Request` on project `BUE`: Unable to create request because of these errors : Field with id 'customfield_11996' named 'Product Line - Tax&AMC' has these errors : Specify a valid value for Product Line - Tax&AMC, Field with id 'customfield_12060' named 'Region' has these errors : Specify a valid value for Region.
that looks like an improvement to me.
Case 3 - with the code
issue.customFields."Region".value = replica.customFields."Region - BUE"
issue.customFields."Product Line - Tax&AMC".value = replica.customFields."Product line - Tax&AMC - BUE"
The error is:
com.exalate.basic.domain.hubobject.v1.BasicHubCustomField type cannot be assigned to custom field 'Region' of type select list.
Case 4 - with the code
issue.customFields."Region".value = replica.customFields."Region - BUE"
issue.customFields."Product Line - Tax&AMC".value = replica.customFields."Product line - Tax&AMC - BUE"
The error is:
Request type `Backoffice & Reporting - Tax&AMC` requires a custom field 11996 of type `com.atlassian.jira.plugin.system.customfieldtypes:select` but none was set through exalate config.
Case 5 - Following your suggestion @Christophe_De_Beule with this code:
issue.customFields."Region".value = replica.customFields."Region - BUE"?.value?.value
issue.customFields."Product Line - Tax&AMC".value = replica.customFields."Product line - Tax&AMC - BUE"?.value?.value
The error is:
Could not create an work item with type `Service Request` on project `BUE`: Unable to create request because of these errors : Field with id 'customfield_11996' named 'Product Line - Tax&AMC' has these errors : Specify a valid value for Product Line - Tax&AMC, Field with id 'customfield_12060' named 'Region' has these errors : Specify a valid value for Region.
(same as Case 2)
I’ve run out of options.
Here’s the related remote replica JSON:
{
"version": {
"major": 1,
"minor": 14,
"patch": 0
},
"hubIssue": {
"voters": [],
"fixVersions": [],
"internalMap": {},
"labels": [
{
"label": "backoffice_reporting_bue_tax"
},
{
"label": "italy_bue"
},
{
"label": "portale_tax_caf_bue"
},
{
"label": "tax_amc_solution_bue"
}
],
"customKeys": {
"isUnstaffedMode": false
},
"assignee": {
"key": "377726464497",
"active": false,
"email": "a*****************com",
"displayName": "a*****************com",
"username": "a*****************com"
},
"entityProperties": {},
"status": {
"id": "open",
"name": "open"
},
"components": [],
"attachments": [],
"customFields": {
"Region - BUE": {
"id": 37898341721617,
"name": "Region - BUE",
"uid": "37898341721617",
"type": "OPTION",
"value": {
"id": "37898341721617",
"value": "italy_bue"
}
},
"Product line - Tax&AMC - BUE": {
"id": 37913472034449,
"name": "Product line - Tax&AMC - BUE",
"uid": "37913472034449",
"type": "OPTION",
"value": {
"id": "37913472034449",
"value": "portale_tax_caf_bue"
}
},
"Portale BUE": {
"id": 37897940102289,
"name": "Portale BUE",
"uid": "37897940102289",
"type": "OPTION",
"value": {
"id": "37897940102289",
"value": "tax_amc_solution_bue"
}
},
"Section Tax&AMC - BUE": {
"id": 37913035628561,
"name": "Section Tax&AMC - BUE",
"uid": "37913035628561",
"type": "OPTION",
"value": {
"id": "37913035628561",
"value": "backoffice_reporting_bue_tax"
}
}
},
"eventTriggerContext": {},
"description": "Prova 12 non considerare",
"watchers": [],
"key": "2087244",
"summary": "Prova 12 non considerare",
"comments": [],
"reporter": {
"key": "378609898417",
"active": false,
"email": "a***************com",
"displayName": "A*********e",
"username": "A*********e"
},
"workLogs": [],
"affectedVersions": []
},
"issueUrl": "https://n******l.zendesk.com/agent/tickets/2087244"
}