# Synchronize attachments in public comments in jira service as public in zendesk

**URL:** <https://community.exalate.com/t/synchronize-attachments-in-public-comments-in-jira-service-as-public-in-zendesk/5032>\
**Category:** General Questions\
**Tags:** exalate, zendesk, jira, zendesk-jira, migrated\_question\
**Created:** [November 4, 2024, 7:39am UTC](https://community.exalate.com/t/synchronize-attachments-in-public-comments-in-jira-service-as-public-in-zendesk/5032 "2024-11-04T07:39:10Z")\
**Posts on this page:** 2\
**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, 7:39am UTC](https://community.exalate.com/t/synchronize-attachments-in-public-comments-in-jira-service-as-public-in-zendesk/5032/1 "2024-11-04T07:39:10Z")

</div>

_Originally asked by Fran Sánchez on 01 February 2022 [(original question)](https://oldcommunity.exalate.com/questions/42831978)_

* * *

Currently all the attachments that I synchronize from Jira Service are syncronized as public to Zendesk. is it possible that the private ones sync as private and the public ones as public? From what I have seen in the information that goes out of Jira I do not see what attribute I can use to differentiate between one and the other?

```auto
BasicHubAttachment{id=10061, remoteId=`null`, mimetype=`image/png`, filename=`normon_WC.png`, created=`Tue Feb 01 10:57:21 UTC 2022`, filesize=`77022`, author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, thumbnailable=`null`, zip='false'}] 

```

Thanks for the help

* * *

---

<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, 7:39am UTC](https://community.exalate.com/t/synchronize-attachments-in-public-comments-in-jira-service-as-public-in-zendesk/5032/2 "2024-11-04T07:39:12Z")

</div>

_Answer by Fran Sánchez on 01 February 2022_

In case it helps I found the solution by placing the following code in the incoming sync part of Zendesk:

```auto
if(replica.addedComments.reverse().find()?.internal == true && !replica.addedAttachments.empty){
        replica.addedAttachments = replica.addedAttachments.collect{
            attachment ->
            attachment.internal = true;
            attachment
        }
}

issue.attachments = attachmentHelper.mergeAttachments(issue, replica)

```

* * *
