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







Log in or Sign up to comment
Community showcase
Published in Agile

On-demand: Fireside chat with Atlassian on scaling agile organizations

Scaling an agile organization and setting it up for success over the long term is a hard thing to do. We hear a common set of questions from customers all the time, questions like: Can agile scal...

762 views 1 8
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