Originally asked by Mikael Bohlin on 13 March 2020 (original question)
How to add a text string in front of the synced comment from JIRA to Zendesk side in order to identify the name of the updater in JIRA.Source: Zendesk (old community)
Originally asked by Mikael Bohlin on 13 March 2020 (original question)
How to add a text string in front of the synced comment from JIRA to Zendesk side in order to identify the name of the updater in JIRA.Source: Zendesk (old community)
Answer by Juan Grases on 13 March 2020
Hi!
You can do something like:
replica.addedComments = replica.addedComments.collect{ c ->
def remoteAuthor = c.author.username
c.body = "Comment from "+remoteAuthor+" in Jira:\n "+c.body
c
}
issue.comments += replica.addedComments
Hi,
thank you for feedback. Unfortunatly the “author” was not synced. I assume this is setup on the incomming side on Zendesk ?
Could you clarify on “the author was not synced”? You mean that the comment from Jira, was created in zendesk with the text "Comment from null in Jira:\n "+c.body ?
Yes , correct we received null from c.author.username in Zendesk.
How to fix ?
It seems username is not available on Jira Cloud due GDPR limitations, you can use email instead:
replica.addedComments = replica.addedComments.collect{ c ->
def remoteAuthor = c.author.email
c.body = "Comment from "+remoteAuthor+" in Jira:\n "+c.body
c
}
issue.comments += replica.addedComments
OK, that worked,
do you have a list of “variables” that we can use ?
Regards
Mikael
Could you create that as a separate question (old community) ?
Thanks!
Juan
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.