# Images in Jira comments not syncing to Azure

**URL:** <https://community.exalate.com/t/images-in-jira-comments-not-syncing-to-azure/4317>\
**Category:** General Questions\
**Tags:** cloud-azuredevops, migrated\_question\
**Created:** [November 4, 2024, 6:47am UTC](https://community.exalate.com/t/images-in-jira-comments-not-syncing-to-azure/4317 "2024-11-04T06:47:26Z")\
**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, 6:47am UTC](https://community.exalate.com/t/images-in-jira-comments-not-syncing-to-azure/4317/1 "2024-11-04T06:47:26Z")

</div>

_Originally asked by Howard Kenny on 20 August 2020 [(original question)](https://oldcommunity.exalate.com/questions/11341589)_

* * *

Hi,

When images are included in Jira comments, Exalate tries to sync them back to the connected Azure issue, but throws an error.

I’m loosely advised !link! needs to be converted into ![]() or something.

Any ideas?  
Source: [Azure DevOps](https://oldcommunity.exalate.com/pages/viewpage.action?pageId=11338824)_(old community)_

* * *

---

<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, 6:47am UTC](https://community.exalate.com/t/images-in-jira-comments-not-syncing-to-azure/4317/2 "2024-11-04T06:47:27Z")

</div>

_Answer by Howard Kenny on 20 August 2020_

Hi André,

Is it safe to post our support zip on this community forum?

PS. our azure node is cloud hosted, so I think you have access to it - [https://azurenode-seta-scye-lobo-bobo.exalate.cloud/](https://azurenode-seta-scye-lobo-bobo.exalate.cloud/) Appreciate that doesn’t give you the Jira zip.

Cheers,

Howard

* * *

#### Comments:

> **André Leroy-Beaulieu Castro commented on 20 August 2020**
>
> > Hey Howard,
> 
> I tested this out on our test environments and I added a comment in Jira without a body, just with an image and it synced the attachment correctly, can you give me more info on how the comment was added in Jira Cloud and how it looks? a screenshot would help!
> 
> Thanks,
> 
> André

> **Howard Kenny commented on 20 August 2020**
>
> > Hi,
> 
> I can’t add the whole screenshot as there’s confidential info on there, but it’s three screenshots in one comment.
> 
> ![](https://dub1.discourse-cdn.com/flex018/download/attachments/11341589/image2020-8-20_17-46-33.png?version=1&modificationDate=1597941993321&api=v2)
> 
> In DevOps, it synced across this like  
> ![](https://dub1.discourse-cdn.com/flex018/download/attachments/11341589/image2020-8-20_17-48-6.png?version=1&modificationDate=1597942086318&api=v2)

> **André Leroy-Beaulieu Castro commented on 20 August 2020**
>
> > Hi Howard,
> 
> and if you go to the attachments screen in the DevOps work item are the three screenshots there?
> 
> The comment looks ok, that’s the same way they were syncing for me in my test environment, but I didn’t get any error associated with it so I’m not sure yet on what may be causing it.
> 
> Thanks,
> 
> André

> **Howard Kenny commented on 21 August 2020**
>
> > Morning,
> 
> No, they weren’t added as attachments.
> 
> Howard

> **André Leroy-Beaulieu Castro commented on 21 August 2020**
>
> > Hi Howard,
> 
> With the normal comment synchronization, the attachments should sync no problem, it must be something about the way you are processing the comment body:
> 
> ```auto
> issue.comments = commentHelper.mergeComments(issue, replica, { comment -> \r                                          
> +
> | comment.internal = true; \r                                                                                       
> +
> | //comment.executor = issue.reporter\r                                                                             
> +
> | // filter out all the mentions, to avoid duplicate notifications\r                                                
> +
> | def processedBody = comment.body.replaceAll("\\[\\~([^\\]]+?)\\]","\$1")\r                                        
> +
> | comment.body = "${comment.author.displayName} commented on ${replica.key}:\n${processedBody}".toString(); \r      
> +
> | comment; \r                                                                                                       
> +
> | }) \r    
> 
> ```
> 
> Is this formatting 100% necessary in your case?
> 
> Thanks,
> 
> André

> **Howard Kenny commented on 21 August 2020**
>
> > HI André,
> 
> Possibly not. It’s whast we’ve always used since Serhiy wrote that script for us in Jira. Can you remind me of the basic version so I can see if that resolves it?
> 
> Cheers,
> 
> Howard

> **André Leroy-Beaulieu Castro commented on 21 August 2020**
>
> > Hi Howard,
> 
> The normal would be:
> 
> ```auto
> workItem.comments = commentHelper.mergeComments(workItem, replica)
> 
> ```
> 
> I’m confident that this will solve the problem!
> 
> Let me know.
> 
> Thanks,
> 
> André

> **Howard Kenny commented on 24 August 2020**
>
> > Hi André,
> 
> That’s cleared the error, after Unexalating and Connecting. However, the images aren’t being added as attachments. It sounds like you’d expect them to be?
> 
> Cheers,
> 
> Howard

> **André Leroy-Beaulieu Castro commented on 24 August 2020**
>
> > Hi Howard,
> 
> Yes I would expect them to be added as attachments, could it be that you are also formatting them or filtering them out iny our Jira Outgoing filter?
> 
> Thanks,
> 
> André

> **Howard Kenny commented on 25 August 2020**
>
> > Morning,
> 
> We have them in the Outgoing sync and also in the If and Else statements on the receiving side (DevOps). This is the snippet:
> 
> ```auto
> issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
> 
> ```
> 
> I should add that it seems images within Jira comments are not added as attachments, so I presume the attachments code isn’t used.
> 
> Any more ideas?
> 
> cheers,
> 
> Howard

> **André Leroy-Beaulieu Castro commented on 25 August 2020**
>
> > Hi Howard,
> 
> In my case when I tried it locally, both comments with body and attachments and comments without a body but with an attachment synced correctly to Azure DevOps and set the attachments succesfully. Can I see how you’re sending comments and attachments from Jira side as well?
> 
> Thanks,
> 
> André

> **Howard Kenny commented on 26 August 2020**
>
> > Morning,
> 
> replica.attachments = issue.attachments
> 
> replica.comments = issue.comments
> 
> Howard

> **André Leroy-Beaulieu Castro commented on 27 August 2020**
>
> > Hi Howard,
> 
> I feel like by now this should be moved to the support channel.
> 
> Thanks,
> 
> André

> **Howard Kenny commented on 27 August 2020**
>
> > Hi André,
> 
> That’s where I raised this initially, but was asked to raise it here - [https://support.idalko.com/servicedesk/customer/portal/8/EASE-5564](https://support.idalko.com/servicedesk/customer/portal/8/EASE-5564)

---

<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, 6:47am UTC](https://community.exalate.com/t/images-in-jira-comments-not-syncing-to-azure/4317/3 "2024-11-04T06:47:34Z")

</div>

_Answer by André Leroy-Beaulieu Castro on 20 August 2020_

Hi Howard,

Since this is giving you an error, could I ask you to create a support request? Just so we can investigate the support zip file and when we have it all figured out I will also post the solution here 😄

Thanks,

André

* * *
