# Jira on premise - local connection with one way comments

**URL:** <https://community.exalate.com/t/jira-on-premise-local-connection-with-one-way-comments/5591>\
**Category:** General Questions\
**Tags:** onpremise-jira, migrated\_question\
**Created:** [November 4, 2024, 8:15am UTC](https://community.exalate.com/t/jira-on-premise-local-connection-with-one-way-comments/5591 "2024-11-04T08:15:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:15am UTC](https://community.exalate.com/t/jira-on-premise-local-connection-with-one-way-comments/5591/1 "2024-11-04T08:15:04Z")

</div>

_Originally asked by Brad Marsh on 25 September 2023 [(original question)](https://oldcommunity.exalate.com/questions/88246910)_

* * *

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

```auto
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

```auto
   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)

  
 

```

* * *

#### Comments:

> **Stéphane Thillay commented on 25 September 2023**
>
> > 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

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:15am UTC](https://community.exalate.com/t/jira-on-premise-local-connection-with-one-way-comments/5591/2 "2024-11-04T08:15:05Z")

</div>

_Answer by Brad Marsh on 25 September 2023_

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

```auto
  if(replica.project.key == "PROJECTB"){
      issue.comments = commentHelper.mergeComments(issue, replica)
   }

```

* * *

#### Comments:

> **Tomas Eduardo Lalanne commented on 28 September 2023**
>
> > 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

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 8:15am UTC](https://community.exalate.com/t/jira-on-premise-local-connection-with-one-way-comments/5591/3 "2024-11-06T08:15:21Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
