1
0
-1

HI Guys, 
I am aware in a Jira to Jira sync (local to remote) how I can make a comment or other fields one way as you have a connection at each end scripted mode. In local mode Jira project A to Project b (Same Jira instance, just different projects) you have a single scripted connection. I am looking for JIRA A not to send any comments and for JIRA B to send all of its comments. 

I have only been able to establish off or on. 

Here is the config I have:

Outgoing

replica.key = issue.key
replica.type = issue.type
replica.assignee = issue.assignee
replica.reporter = issue.reporter
replica.summary = issue.summary
replica.description = issue.description
replica.labels = issue.labels
// replica.comments = issue.comments
replica.resolution = issue.resolution
replica.status = issue.status
replica.parentId = issue.parentId
replica.priority = issue.priority
replica.attachments = issue.attachments
replica.project = issue.project



//Comment these lines out if you are interested in sending the full list of versions and components of the source project.
replica.project.versions = []
replica.project.components = []



Incoming

   if(firstSync && replica.project.key == "ProjectB"){
      issue.projectKey   = "ProjectA"
      issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
   }
   if(firstSync && replica.project.key == "ProjectA"){
      issue.projectKey   = "ProjectB"
      issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
   }

   issue.status = replica.status
   issue.priority = nodeHelper.getPriority(replica.priority?.name, issue)
   issue.summary = replica.summary
   issue.description = replica.description
   issue.comments = commentHelper.mergeComments(issue, replica)
   issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
   issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email)
   issue.reporter = nodeHelper.getUserByEmail(replica.reporter?.email)

  
 




  1. Stéphane Thillay

    Hi Brad,


    If you can distinguish the target project then you might put the issue.comments = ... line behind a check on what is the project. Doing so, only the wanted project would get (would take care of) the comments.

    Comments would be "outgoing" all the time but ignored only for project B.


    Regards,

    Stéphane

CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

    I resolved this through a simple if statement in the incoming and uncommented the outgoing

      if(replica.project.key == "PROJECTB"){
          issue.comments = commentHelper.mergeComments(issue, replica)
       }
    
    
    1. Tomas Eduardo Lalanne

      We are glad, that you were able to resolve it and if further assistance is needed please feel free to contact us once again.

      BR

    CommentAdd your comment...