Zendesk - attachments are always public

Originally asked by Francis Martens (Exalate) on 08 May 2022 (original question)


You can see that one of the comments posted by the Exalate connections is placed as “Public” meaning this had been e-mailed to a customer. They should always be internal. Can you help with the script on this matter, see what needs to be changed to make this work well?


Answer by Francis Martens (Exalate) on 08 May 2022

The attachment object has a property ‘internal’ which allows to set it internal.

Following script is doing the trick

Incoming sync | Zendesk

issue.attachments  += replica.addedAttachments.collect {
    attachment ->
    
    attachment.internal = true
    attachment
}