1
0
-1

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:


issue.customFields."Acceptance Criteria".value = replica.customFields."Acceptance Criteria".value


 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 


    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi!

      The problem here is on line:

      issue.projectKey = replica.customFields."Vendor Name"?.value?.value 
      issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name 

      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.


      Best regards,

      Juan

        CommentAdd your comment...