The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Jira automation: how to add a watcher by email?

Dmitry Shulga
March 25, 2024

I have an incoming bug reports that have the author's email in the description. I can successfully extract it. The emails are our company emails that match the Jira user emails. Unfortunately, if I try to add that email via a variable using "Manage Watchers" action, it doesn't work. And I don't see any other action to find a user by email. Am I out of luck?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
Tugba Capaci
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
March 26, 2024

Hi @Dmitry Shulga ,


You can find users by email and set them as watchers of an issue by sending a web request.


Check out this post:


https://community.atlassian.com/t5/Jira-Service-Management-articles/Populate-a-user-picker-field-from-the-description-field/ba-p/2134905


For your case, it might be:

  • Just extract your user email from the description and create a variable for userEmail with this smart value:

           {{description.match("This bug is created by \s(.*)")}}

  • Add Send web request node and write the call

       GET https://your-domain.atlassian.net/rest/api/3/user/search?query={{userEmail}}

 Screenshot 2024-03-26 at 10.40.12.png

  • Add Add watchers node and write the smart value

          {{webResponse.body.first.accountId}}

Screenshot 2024-03-26 at 10.39.45.png

I hope this helps.


Tugba
actioner.com

Dmitry Shulga
March 26, 2024

Wonderful! Thank you!

Like • Tugba Capaci likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events