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/ 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.
In DevOps, it synced across this like
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:
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:
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:
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