1
0
-1
- Peter Hochstrasser
- Sep 14, 2019
Hi
You have excellent documentation on how to take over and cleanup comments in various ways:
- impersonate comments, or rather, add a header to the comment that mimicks the original comment lead in:
" added a comment on -"
- remove @mentions in bodies to avoid unnecessary notifications
- merging new and existing comments
Now, I'd like to combine these three, such that the final comment body has:
- the original author,
- the updated date,
- no @mentions, but the displayNames of the users who have been mentioned.
All this is for an intra-instance JIRA Server sync, so, all usernames are available in both JIRA projects.
How do I do that?
Source: Jira Server/Datacenter
- connector-onpremise-jira
- Comment
CommentAdd your comment...
1 answer
- 10-1
Challenge accepted
The sanitization needs to be done when composing the message and sending it to the other side>
Add the code snippet from sanitize_mentions.groovy to the outgoing sync of the connection (and remove the standard replica.comments = issue.comments)The formatting of the comment body on the receiving side can be done with following snippet (available here)
- Line 15 calls mergeComment using a closure 'formatBody'
- Formatbody will apply the formatting logic.
- Line 5 builds the header - user hyperlinked to its mail address, and the date formatted as day / month / year
- Line 6,7,8 formats the original comment body as a quote
Results in
When the user directory on both ends are identical - like in your case, you can include the mention sanitization on the destination end - example snippet here
CommentAdd your comment...
Overview
Content Tools
search
attachments
weblink
advanced