JMWE: Add Mentioned User to Watchers

Tarieli Gvritishvili May 28, 2024

Hello,

 

How is it possible to add mentioned user(s) in comments to Watchers using JMWE plugin?

 

Thanks in advance!

2 answers

1 vote
Nagabharana S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 28, 2024

Hello @Tarieli Gvritishvili

You can reach the JMWE vendor support from here for faster assistance. Just in case if you would like to try this using the Automation for Jira let us know we can help. :)

Thanks. :)

 

0 votes
Teja(Appfire) May 31, 2024

Hi @Tarieli Gvritishvili ,

Good day!

To add the mentioned user(s) in comments to Watchers, you can use https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465473524/Event-based+actions. Under Event-based actions, select the 'Issue commented' event and then specify the scope of projects and issue types. In the post functions, select the 'Set issue fields' post function https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465504849/Set+issue+fields.

image-20240530-174131.png

In 'Set issue fields', add the field as watcher and in the watcher field, add the following code:

{% set text = context.comment.body %}

{% set regex = r/accountid:[a-z0-9]+/g %}
{% set matches = text.match(regex) %}

{% if matches %}
{% set transformed_matches = [] %}
{% for match in matches %}
{% set transformed_match = match.replace('accountid:', 'accountId:') %}
{% set test = transformed_matches.push(transformed_match)%}
{% endfor %}
{% set formatted_ids = transformed_matches | join(',') %}
{{ formatted_ids }}
{% endif %}

Note: Please make sure you select options to append values to the field.

Screenshot 2024-05-30 at 11.08.26 PM.png

Thanks,
Teja 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events