Note
We've packed up and moved from Confluence to Discourse to bring you a better, more interactive space. Out of courtesy we didn't migrate your user account so - you will have to signup again
The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe
I have the following code
JIRA SENDING SIDE
replica.customFields."Functional Area – PCM”= issue.customFields."Functional Area - PCM"
ALM INCOMING SIDE
defect.customFields."FunctionalArea".value = replica.customFields."Functional Area - PCM"?.value.value
Previously the sync rules allowed the below code
defect.customFields."FunctionalArea".value = replica.customFields."Functional Area - PCM"?.value?[0].value
and our sync worked ,but now the above line is throwing error
Even though i am copying the field name from the remote replica ,still its showing Null value.
Below is the remote replica
"Functional Area – PCM": {
"id": 15205,
"name": "Functional Area - PCM",
"uid": "15205",
"type": "OPTION",
"value": {
"id": "22009",
"sequence": 6,
"value": "PCM",
"disabled": false,
"childOptions": []
}
}
},
SANDEEP ADE
What is the error thrown?
I am getting "Cannot get property 'value' on null object"
But in the remote replica i am seeing the below
"Functional Area – PCM": {
"id": 15205,
"name": "Functional Area - PCM",
"uid": "15205",
"type": "OPTION",
"value": {
"id": "22009",
"sequence": 6,
"value": "PCM",
"disabled": false,
"childOptions": []
}
}
},
I tried the below options but both are throwing error
defect.customFields."BG_USER_02".value = replica.customFields."Functional Area - PCM".value.value
defect.customFields."BG_USER_02".value = replica.customFields."Functional Area - PCM".value(0).value
Can it be that defect.customFields."BG_USER_02" is null?
i didn't quite get what you said
BG_USER_02 is a field in ALM ,i am trying to populate the value "PCM" received from Functional Area – PCM from JIRA in BG_USER_02 which is ALM.
i have the code as below,
JIRA SENDING SIDE
replica.customFields."Functional Area – PCM”= issue.customFields."Functional Area - PCM"
ALM INCOMING SIDE
defect.customFields."BG_USER_02".value = replica.customFields."Functional Area - PCM".value.value
and to confirm Functional Area - PCM is not Null because in the remote replica i am seeing value as PCM for this field
So not sure whats the issue
It can still be that the nullpointerexception is raised by
So the question - can you check what defect.customFields."BG_USER_02" returns when doing
javax.script.ScriptException: com.exalate.api.exception.IssueTrackerException: defect.customFields.BG_USER_02 = [value:null, type:STRING, class:class com.exalate.basic.domain.hubobject.v1.BasicHubCustomField, uid:BG_USER_02, id:null, locked:false, description:null, name:null]
i got this error
Also i added below line
def remoteValue = replica.customFields."Functional Area - PCM".value.value to see the value on incoming remote field ,it gave error as Cannot get property 'value' on null object
but i see the value in remote replica
its resolved now
issue was the "-" symbol ,the field name is Functional Area - PCM
and in script it was types as Functional Area – PCM