# Converting user mentions in the cloud format when there is an incoming sync from the DC/Server

**URL:** <https://community.exalate.com/t/converting-user-mentions-in-the-cloud-format-when-there-is-an-incoming-sync-from-the-dc-server/4648>\
**Category:** General Questions\
**Tags:** usecase, script, migrated\_question\
**Created:** [November 4, 2024, 7:13am UTC](https://community.exalate.com/t/converting-user-mentions-in-the-cloud-format-when-there-is-an-incoming-sync-from-the-dc-server/4648 "2024-11-04T07:13:10Z")\
**Posts on this page:** 2\
**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, 7:13am UTC](https://community.exalate.com/t/converting-user-mentions-in-the-cloud-format-when-there-is-an-incoming-sync-from-the-dc-server/4648/1 "2024-11-04T07:13:10Z")

</div>

_Originally asked by Eshwar Palem on 18 March 2021 [(original question)](https://oldcommunity.exalate.com/questions/25070061)_

* * *

Hi there,

Can someone help me in modifying the script, so that when there is incoming sync of comments from Server/DC to cloud Jira it should convert user mentions in the cloud format so that it updates properly in the comments?

I have managed to do this on Server/DC Jira when there is incoming sync from the cloud. However, I am facing difficulties while doing the same for the cloud.

Please help me with this.

Thanks,

Eshwar.

* * *

#### Comments:

> **Serhiy Onyshchenko commented on 19 March 2021**
>
> > Hey, Eshwar Palem, might I ask you to share your Outgoing sync script from on-prem  
> > and your incoming sync script for cloud (maybe just the parts concerning comments)?

---

<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, 7:13am UTC](https://community.exalate.com/t/converting-user-mentions-in-the-cloud-format-when-there-is-an-incoming-sync-from-the-dc-server/4648/2 "2024-11-04T07:13:11Z")

</div>

_Answer by Serhiy Onyshchenko on 19 March 2021_

Also have you seen this article?  
[https://community.atlassian.com/t5/Agile-articles/How-to-sanitize-mentions-when-synchronizing-issues/ba-p/1141139](https://community.atlassian.com/t5/Agile-articles/How-to-sanitize-mentions-when-synchronizing-issues/ba-p/1141139)  
you could replace every mention sent from server with email:

```auto
/*
** This code snippet illustrates how mentions can be replaced with the actual name of the mentionee
** Use this in a data filter
*/

replica.comments = issue.comments.collect {
			  comment ->
              

              def matcher = comment.body =~ /\[~(\w+)\]/
              def newCommentBody = comment.body

              matcher.each {
                  target = "[~$nodeHelper.getUser(it[1])?.email]"
                  newCommentBody = newCommentBody.replace(it[0], target)
              }

              comment.body = newCommentBody
              comment
}

```

And then use similar logic on cloud to lookup a user using email  
Please, let me know if this helps

* * *
