Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to sanitize mentions when synchronizing issues

(I'm Francis - product manager for Exalate - an issue synchronisation solution)



Last week, we got following request -


Hi Francis,


We are using a competing issue synchronisation solution.  One of the problems we encounter is that whenever we synchronise a comment, the mentions in that comment are also synchronised - triggering confusing notifications - especially when there are overlapping user id's


Ie. For instance you have @peter in the comment.  The comment gets synchronised to the other instance, which triggers a 'You have been mentioned' notification to a complete different Peter (who happens to have the same userid)


How would Exalate deal with it.


Challenge accepted!


Ideally, all the mentions in comments sent to the other side are replaced with the name of the person mentioned.  So what should happen


Whenever composing the outgoing synchronization message (aka the data filter)

  • For every comment
    • For every mention in the comment
      • Look up the user being mentioned
      • Replace the mention with the name of the mentioned person


With the groovy based scripting engine, it is pretty straightforward to have it done



  • Line 18 - iterate over all the issue comments
  • Line 21 - RegEx which collects all the mentions in the comment body
    A mention is stored as [~<userid>]
  • Line 24 - Iterate over all the mentions found in the body
  • Line 25 - Look up the mentioned user object using the nodeHelper.getUser
    • If the user is found, set target to display name
    • if the user is not found, set target to the userid of the user
  • Line 26 - Replace all the mentions for this specific user to the constructed target
  • Line 29 - Assign the new comment body to the comment

(The code snippet above can be found here)

What is the effect

Now whenever someone creates a comment on the source like following message




The piece of groovy code will replace the mentions of Peter and Angie with their Full Name, and send this over to the other side, resulting in 




Other use cases


This is just an example of what the flexibility provided by Exalate allows to do. 
You can imagine that you want to filter out the names of the people (for security or GDPR reasons) or map the mentioned users from the source user to the target user.


Many more use cases can be implemented.  We are looking forward to solving your synchronization challenges.  Welcome to book a meeting here







Log in or Sign up to comment

Hi @francis , 

Thanks for this use case, really helpful.

Related challenge: How would you assign a ticket to a user then given it is not in the source system ? 


Thank you,

Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Jan 17, 2021

What is the logic behind it.  You can always look up the right assignee using the nodeHelper.getUserByEmail  method (or similar), and set the assignee accordingly


btw - Checkout the exalate community there are many similar cases being discussed.

I haven't had much luck with this and have a few questions.

Is the [~<userid>] format unique to how exalate packages the data during the outgoing sync?  I don't think that format holds up on the Jira side for user mentions.

Is this meant to be configured in the outgoing sync rule of the source cloud project?

Are there any considerations for the incoming sync rules on the target server project?



Hi @Semi Ajibola ,

I am not sure if I understand your question but let me give it a try. In our connection Cloud <-> Server, I have modified the script in outgoing sync of the cloud project, so that it can change the format of user mention from cloud to server format. Below is the script


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

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

matcher.each {
target = nodeHelper.getUser(it[1])?.email?: it[1]
String[] name = target.split("@")
String mention = "[~"+name[0]+"]"
newCommentBody = newCommentBody.replace(it[0],mention)

comment.body = newCommentBody


AUG Leaders

Atlassian Community Events