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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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






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,

francis Marketplace Partner 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



Log in or Sign up to
This widget could not be displayed.
Community showcase
Published in Agile

Master the art of thinking big, working small: A conversation with John Cutler

Hello all! It has been 20 years since the agile manifesto was introduced, and closer to 40 years since software development began moving away from a waterfall-type approach. While many teams have ...

1,249 views 8 21
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you