Originally asked by Harold Oconitrillo on 14 September 2023 (original question)
Hello support.
Main goal is to be able to create a bi-directional sync. from Azure Devops Board to Jira.
Here the first issues that I have so far:
Context: using Exalate in Script mode From Azure Work item(Outgoing sync ) to Jira Cloud Issue (Incoming sync) ( note: as a start we need Azure to Jira sync. but our main goal is to have bi-directional sync )
To reproduce my situation:
- From Azure Board create a work item
- in the Description add some text
- Add an image by pasting from a print screen
- Save
- Reopen the same work item
- add a Comment
- Add an new image by pasting from a new print screen
- Save
- in the Description add some text
Azure DevOps Board - Exalate outbound
// Azure DevOps Board - Exalate outbound
replica.description = workItem.description // Note description will contain HTML
replica.attachments = workItem.attachments
replica.comments = workItem.comments // Note comment will contain HTML
NOTE from the Jira Exalate connection information of the Remote replica entity section about the Attachments
"attachments": [
{
"id": "5729801f-8a84-4dd6-adc7-7521854a47d2",
"filename": "image.png",
"internal": false,
"zip": false
},
{
"id": "fbc509af-2794-4766-b347-99a7fd7bd688",
"filename": "image.png",
"internal": false,
"zip": false
}
],
Jira Cloud - Exalate Incoming sync
// Jira Cloud - Exalate Incoming sync
import com.exalate.transform.HtmlToWiki
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
HtmlToWiki htwDesc = new HtmlToWiki(replica.attachments)
String wikiDescriptionText = htwDesc.transform(replica.description) // replica as HTML Jira understands wiki
issue.description = wikiDescriptionText
HtmlToWiki htwComment = new HtmlToWiki(replica.attachments) // // replica as HTML Jira understands wiki
issue.comments = commentHelper.mergeComments(issue, replica, {
comment ->
comment.body = htwComment.transform(comment.body)
comment
})
The result in the Jira issue, both the description and comment text fields have the same image (The last image added to the comment, the second image.png).
I did try the suggested solution from : https://community.exalate.com/display/exacom/questions/20124163/exalating-attachments-pasted-images-on-azuredevops-result-in-same-name-files-on-receiving-jira-side
Solution to rename the filename values in replica.attachments but the HtmlToWiki::processImage methode/function base it self on the HTML content only to scans for filename in the Image ‘src’ attribute. Giving me a broken in-line image link on the Jira side.
Since the Field content (HTML) (description and/or comments) in-line images information need/must fit the attachment information in order to resolve the image information to display in the proper context. There is a missing part to the solution.
Hypotheses:
So by renaming the images from azure to Jira …in Jira new filename ….when will do the other sync Jira to Azure inbound script even using the attachmentHelper.mergeAttachments tool … are those images are added to the work item making duplicates because their is different filenames.
Main goal is to be able to create a bi-directional sync. from
- Azure Devops Board
- Jira Cloud
Help would be appreciated,