Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Is there a way to modify attachement comment in Zendesk

 
1
0
-1

Hi. I have a connection for Zendesk with Jira using exalate.


I would like to customize the comment being added to the Zendesk when a new attachment arrives.


Right now I use the code for attachment sync provided here Attachment in internal Zendesk comment ?


replica.addedAttachments = replica.addedAttachments.collect{it.internal = true; it}
issue.attachments  = attachmentHelper.mergeAttachments(issue, replica)

When a new attachment arives the code adds this comment along with the attachment 

However I would like to write in such case other text.



Is there a way to do it?



Thanks

Sanyi

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Sanyi,

      The headline comment added that comes with the attachment, it cannot be modified at the moment. But did you try the following?

      if (replica.addedComments && !replica.addedAttachments.empty)  { 
      issue.comments = commentHelper.mergeComments(issue, replica,                     
                          {
                             comment ->
                             comment.body = "Attachment received"
                          }
      )
      }
      issue.comments += replica.addedComments
      } 
      replica.addedAttachments = replica.addedAttachments.collect{it.internal = true; it}
      issue.attachments  = attachmentHelper.mergeAttachments(issue, replica)
      


      Kind regards,

      Ariel

        CommentAdd your comment...