Syncing User-Mentions in Comments between Jira Cloud and Azure-DevOpsIntroduction
Exalate can be used to synchronize the user mentions in Comments between Jira and Azure DevOps.
In this tutorial, we will delve into the script mode of Exalate to demonstrate how user-mentions in comments from Jira can be integrated with Azure DevOps bi-directionally so that a user can get notified if he/she gets mentioned on an issue.
However, it is important to note that the prerequisite for this integration is that the email address of the user must be identical in both the Azure DevOps and Jira Cloud instances.
This requirement establishes a reliable connection point for Exalate to match and synchronize the data effectively.
- ADO to JIRA Sync:
Here is the high level notes:
- In ADO, user mentions are written in following HTML code:
<div><a href="#" data-vss-mention="version:2.0,{user id}">@John Doe<a/> Testing mentioning</div>
- We need to fetch the {user id} from this HTML code and using this user id, find the email id of that user
- For that, we are using getUser method with ADO Project Key
- Replace this whole <a> tag with following code:
[~accountid:{email id}]
Here is the high level notes:
- From ADO, we are receiving comment in following format:
[~accountid:{email id}]
- We are fetching these emails using regex (of course there might be multiple mentions)
- Using getUserByEmail method, we are fetching user account key using that email id
- Then replacing email id with account id
2. JIRA to ADO Sync:
Here is the high level notes:
- JIRA stores user mentions in following format:[~accountid:{account id}]
- So we are fetching account id using the regex and for that account id we are fetching email id of the user
- Now, at target side we need to replace Jira's format with ADO format, to avoid other email id (may be written in plain text) we are sending User mentions between specified string
- We are sending email ids in following format:
#exalate_comment#{Email_id}#exalate_comment_end#
- Instead of "Stranger" we can use email id of default user
Here is the high level notes:
- From JIRA we are receiving user mention information as follows:
#exalate_comment#{Email_id}#exalate_comment_end#
- Following is the format in ADO for user mentions:
<div><a href="#" data-vss-mention="version:2.0,{user id}">@John Doe<a/> Testing mentioning</div>
- So, from each comment we are getting email id, we use getUserByEmail method to get ADO user account key corresponding to that email id
- Then replace the format coming from JIRA with ADO user mention format
Note: Comment or remove script which is already there for comment
Video :
Questions
Recent Questions
- 0votes
- 0votes
- 0votes
- 0votes
- 0votes
- 0votes
- 0votes
- 0votes
- 0votes
- 1vote