# JIRA to Zendesk - add comment

**URL:** <https://community.exalate.com/t/jira-to-zendesk-add-comment/4176>\
**Category:** General Questions\
**Tags:** cloud-zendesk, migrated\_question\
**Created:** [November 4, 2024, 6:36am UTC](https://community.exalate.com/t/jira-to-zendesk-add-comment/4176 "2024-11-04T06:36:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 6:36am UTC](https://community.exalate.com/t/jira-to-zendesk-add-comment/4176/1 "2024-11-04T06:36:37Z")

</div>

_Originally asked by Mikael Bohlin on 13 March 2020 [(original question)](https://oldcommunity.exalate.com/questions/11338360)_

* * *

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](https://oldcommunity.exalate.com/pages/viewpage.action?pageId=3703241)_(old community)_

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 6:36am UTC](https://community.exalate.com/t/jira-to-zendesk-add-comment/4176/2 "2024-11-04T06:36:38Z")

</div>

_Answer by Juan Grases on 13 March 2020_

Hi!

You can do something like:

```auto
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

```

* * *

#### Comments:

> **Mikael Bohlin commented on 16 March 2020**
>
> > Hi,
> 
> thank you for feedback. Unfortunatly the “author” was not synced. I assume this is setup on the incomming side on Zendesk ?

> **Juan Grases commented on 16 March 2020**
>
> > 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 ?

> **Mikael Bohlin commented on 19 March 2020**
>
> > Yes , correct we received null from c.author.username in Zendesk.
> 
> How to fix ?

> **Juan Grases commented on 19 March 2020**
>
> > It seems username is not available on Jira Cloud due GDPR limitations, you can use email instead:
> 
> ```auto
> 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
> 
> ```

> **Mikael Bohlin commented on 19 March 2020**
>
> > OK, that worked,
> 
> do you have a list of “variables” that we can use ?
> 
> Regards
> 
> Mikael

> **Juan Grases commented on 19 March 2020**
>
> > Could you create that as a separate question _(old community)_ ?
> 
> Thanks!
> 
> Juan

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 6:37am UTC](https://community.exalate.com/t/jira-to-zendesk-add-comment/4176/3 "2024-11-06T06:37:25Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
