Tagged User in Comment Body

Originally asked by Jamie McCulloch on 08 September 2020 (original question)


Exalate seems to fit all the use cases I need it for, but one quick query though, when I comment tagging someone (on a cloud site) then the comment is synced to the server side, the account ID appears instead of the name. This makes sense with GDPR etc. but I notice that we can use user mapping for the worklogs being synced to get around this.

Is there a way we can do this for the body of comments?

Thanks!

Server side ^

Cloud Side ^


Answer by Francis Martens (Exalate) on 10 September 2020

Looking into it.


Comments:

Francis Martens (Exalate) commented on 11 September 2020

I did a test - and it seems to behave normally

Cloud

Server

So I was wondering how comes (obviously)

Looking at my profile (id.atlassian.com)
I can see

(more information - https://confluence.atlassian.com/x/6IS8OQ)

Could you check on your side?

Jamie McCulloch commented on 13 September 2020

Hi Francis, yeah the comments go over fine with the correct user, the problem comes from trying to tag a user in the comment itself, i.e. “@Jamie McCulloch would you be able to look into this” becomes “accountId:xyz12341 would you be able to look into this”.

I am aware this might fall under the GDPR rulings and everything, so I was just wondering if there was a way to map users from instance to instance for comments, as seems possible for worklogs (seen https://docs.idalko.com/exalate/display/ED/Worklogs+synchronization)

Thanks in advance,

Jamie

Francis Martens (Exalate) commented on 13 September 2020

You will have to retrieve the user details using the nodeHelper methods.
Check the following article on answers.atlassian.com
How to sanitize mentions when synchronizing issues

Which should give you a clue how to address this one.

Jamie McCulloch commented on 13 September 2020

Ah that looks perfect, thanks a lot!

Jamie McCulloch commented on 15 September 2020

Thank you for this! I have tried this and after some trial and error got it working well for two accounts, but not for others. I edited the script to remove “atlassianid:” from the prefix, and this worked. However whenever the account ID contains a dash or colon (i.e. 557058:fdadsf-d5b7-4e85-b50c-ffdas43123). Is this due to the regex taking a word up to a punctuation mark and then trying to search for that?

Francis Martens (Exalate) commented on 15 September 2020

Probably. People who understand RegEx have all a Noble Price of mathematics, and I’m certainly not one of them.

I’m using https://regex101.com/ to test the regex. It is pretty good at explaining how the regex is mapped to the input.