Originally asked by Patrick Kolodziejczyk on 08 August 2023 (original question)
Hi,
I am currently trying to synchronise :
- Content of comments from Jira to Salesforce
- Content of comments from Salesforce to Jira
My current implementation is half working :
For example, the Jira input :
test italique underligne
Become in Salesforce:
Kolodziejczyk commented: <p><b>test</b> <em>italique</em> <ins><em>underligne</em></ins></p>
With the outgoing script on jira:
replica.comments = nodeHelper.getHtmlComments(issue)
And the incoming script on Salesforce
entity.comments = commentHelper.mergeComments(entity, replica)
I have try to make manual modification in the incoming script of Salesforce, but it’s always consider my HTML as pur String (not interpreted).
A image content from Jira display in salesforce the result is about the same :
Kolodziejczyk commented: <p><span class=“image-wrap” style=“”><img src=“/rest/api/3/attachment/content/18039”></span></p>
And a image content from Salesforce is display an image but the markdown is :
!sfdc://069Aa000000d5npIAA!
And not the name of the image.
Using Outgoing script Salesforce :
replica.comments = entity.comments
And incoming script Jira :
issue.comments = nodeHelper.toMarkDownComments(commentHelper.mergeComments(entity, replica))
My question are the following :
- How to have Salesforce understand that the body is in HTML and should be interpreted ? (That the only things that i can’t resole by custom code at the moment)
- The image source conversion from Salesforce URL to Jira name is in the standard or should I implement it ?
Comments:
Patrick Kolodziejczyk commented on 08 August 2023
For the Jira to Salesforce part,
It’s look like, the property isRichText on the object “FeedItem” that is created is left to false. And that field isn’t editable in the Exalate script.
In addition, it’s look like the conversion to HTML isn’t properly done.
italic is done with and not
underline is done with and not
Using Salesforce Inspector : and are rejected when isRichText is witch to true.
The replacement of *and can be done by a customisation of mergeComments, but shouldn’t be done in my point of view.
FeedItem.isRichText isn’t set to true nor accessible is a problem that can’t be fix. FeedItem properties can’t be modify in the Admin part and the Chatter configuration doesn’t inclued the capacity do modify default value of the underlying object.*
Look like, not all FeedItem are provided on the outgoing on the salesforce side. Only the FeedItem of type “TextPost” are provided.
FeedItem of type “ContentPost” are missing.
Meaning comment that got an attached file aren’t provided for synchronisation.