I have two JIRA server instances, and when I try to sync I got below: Script error details: Ambiguous method overloading for method It was working before, not sure at which point it starts breaking, I added recently:
Below is the rule on the receiving systems: ===========
if(firstSync){ // If it's the first sync for an issue (local issue does not exist yet)
issue.projectKey = replica.customFields."Vendor Name"?.value?.value
// Set type name from source issue, if not found set a default
issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name
}
issue.summary = replica.summary
issue.description = replica.description
nodeHelper.getIssueType is failing when the second parameter is null. In this case is null because the value of the remote custom field “Vendor Name” is empty (or it was not properly set from the sending side).
You can work around this by doing something like:
def vendorName = replica.customFields."Vendor Name"?.value?.value
if(vendorName == null)return; //This will cancel the sync if you are not receiving a value on vendor name
issue.projectKey = vendorName
issue.typeName = replica.typeName
There is actually no need to use the nodeHelper to get the issue type name, if you know that the receiving type also exists in your system.