I want to filter out internal Salesforce Case Comments from JIRA and then for Text Post in Salesforce that is coming over in HTML format so the script needs to do 2 things
Filter out Case Comments because these have the Internal Lock icon and should only be used as such.
The comments that do get sent via exalate should not be in HTML format.
Hi @Jacob_Kalaj
Here are my questions regarding both of your points:
Do you mean you want to filter comments from Salesforce to Jira, or you just want to sync all the comments from salesforce to Jira and then in Jira you want to decide internal or public comment?
I think, this we already handled in this post: ticket:Salesforce Custom Text Field to JIRA Description needs HTML Conversion in Script - #7 by Jacob_Kalaj
isn’t it, or let me know if you have other question?
Thanks,
Sonal
Hey @Sonal_Otwani
1 Yes I would like if a comment gets marked Internal or it is a case comment that it doesn’t go to JIRA comments.
2 that was for the description field and I was not aware if it was going to be similar code or not this is the comments that also come in html
Hi @Jacob_Kalaj
For 2nd issue:
You can replace following line in your incoming sync script:
issue.comments = commentHelper.mergeComments(issue, replica)
with:
issue.comments = nodeHelper.toMarkDownComments(commentHelper.mergeComments(issue, replica))
I hope this will work , or let me know in case it is not working. Will wait for your update !
I will work on 1st issue and will update you.
Thanks,
Sonal
1 Like
Perfect this worked for HTML in comments appreciate it @Sonal_Otwani will wait on the second piece then mark solution
Hi @Jacob_Kalaj
This is just to confirm again, you want to sync case comments only(not chatter feed). If that is the case here is the outgoing sync script for Salesforce:
def id=entity.Id
def allc = httpClient.get(“/services/data/v54.0/sobjects/Case/${id}/CaseComments”)
double comment_size_d=allc.totalSize
int comment_size = comment_size_d.intValue();
def allComments=allc.records
def SFComments=allComments.collect
{
c->
def comment = commentHelper.addComment(c.CommentBody, ).find()
def internal=true
if(c.IsPublished)
{
internal=false
}
comment.internal = internal
comment.id = c.Id
comment.created=null
def authorUser=new com.exalate.basic.domain.hubobject.v1.BasicHubUser()
authorUser.setKey(c.CreatedById)
comment.author=authorUser
comment
}
//replica.comments=issue.comments
replica.comments=SFComments.findAll{!it.internal}
Kindly explain in more detail in case your use case is different.
Thanks,
Sonal
Hi Sonal,
for my information - why do you need to use httpClient to get the comments. Doesn’t the entity.comments contain all the same?
Majid
January 9, 2025, 7:49am
9
I think the reason is that the CaseComments are not populated within the replica. Exalate uses the ChatterFeed to populate entity.comments.
Ref: Reddit - Dive into anything
1 Like
Ah ok - Case Comments are deprecated by Salesforce. Alright. Thanks.
2 Likes
ok so thanks for asking, almost the opposite is needed actually. @Sonal_Otwani
Case Comments - we are using internal in SFDC for our tech support internal communications. I don’t want these going to JIRA.
Text Post (Chatter Feed) we want to use to sync to JIRA to communicate with engineering in JIRA.
Case Comments seem to auto mark as Internal with a lock icon, I want those to stay in Salesforce, today they also go to JIRA.
Hi @Jacob_Kalaj
Will check and update you.
Thanks,
Sonal
Just following up here, wondering if this is a SF limitation since they are both related to the comment object ?
Yes , both are comment object for Exalate. I think we can find a way to fetch the feeds only same as i mentioned for case comments here:
Hi @Jacob_Kalaj
This is just to confirm again, you want to sync case comments only(not chatter feed). If that is the case here is the outgoing sync script for Salesforce:
def id=entity.Id
def allc = httpClient.get(“/services/data/v54.0/sobjects/Case/${id}/CaseComments”)
double comment_size_d=allc.totalSize
int comment_size = comment_size_d.intValue();
def allComments=allc.records
def SFComments=allComments.collect
{
c->
def comment = commentHelper.addComment(c.CommentBody, ).find()
d…
ok will pitch this to my Tech Support team, so just confirming this above script is the Outgoing in SFDC, there is no change to Incoming JIRA script and what this will do: @Sonal_Otwani
Case Comments ONLY will go to JIRA
JIRA comments will go to the feed in SFDC
Feed Comments on the case will NOT go back to JIRA
hi @Jacob_Kalaj
yes correct
system
Closed
January 17, 2025, 2:00pm
17
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.