Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JIRA REST API create ticket with watchers [watchers are emails only]

nadunindunil September 17, 2018

Is there any possible way I can create an issue same time adding watchers using the emails of the users? 

I could separately add watchers using the userId but I want it using the user email.


I have tried this: https://community.atlassian.com/t5/Answers-Developer-Questions/JIRA-REST-API-create-ticket-with-watchers/qaq-p/495635

and many methods but didn't help!

Thanks in advance.

3 answers

2 votes
Prince N
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 26, 2018

Hi Nadun,

Apparently on Jira Cloud doesn't have that feature that will enable you to add a Watcher during issue creation. You will need to do it via the UI or REST API through cURL after the issue has been created.

Example using cURL to Add Watchers (Jira Cloud)

 curl --request POST \
--url 'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/watchers' \
--user 'your-email@example.com:<api_token>' \
--header 'Content-Type: application/json' \
--data '"fred"' 

You will need to use the username and not email address as the development docs didn't specify the email address field.


Although, there is a feature request on Ability to add watchers during issue creation which is still open as there's no current plan in it's implementation.

Cheers,

Prince

Prem Marcel July 11, 2021

Hi @Prince N ,

 

I had create the Jira from rest API and I am trying to add the file watcher though Curl methodology.

 

And I had passed all the input which you had showed in the above snippet.

But its getting 400 response, Please let me know ,how  we need to add watcher for a Jira ticket  through Curl

 

Thanks in advance.

Jake McDonnell September 29, 2023

Is there way to add custom email to issue watchers (Cloud Jira)? I need to provide customers ability to watch submitted issue status. I'm trying to use Atlassian Account Id (i.e. f4ab4cd9b6345eb511ee8259) when adding issue watcher (/rest/api/2/issue/<issueId>/watchers), it works if the that id of api token user, but getting error for it is a custom Atlassian Account id. Currently I'm able to set issue reporter using the same method but it is not working with issue watch. The api user have admistrator permissions.

0 votes
Jake McDonnell September 29, 2023

Is there way to add custom email to issue watchers (Cloud Jira)? I need to provide customers ability to watch submitted issue status without jira access. I'm trying to use Atlassian Account Id (i.e. f4ab4cd9b6345eb511ee8259) when adding issue watcher (/rest/api/2/issue/<issueId>/watchers), it works if the that id of api token user, but getting error for it is a custom Atlassian Account id. Currently I'm able to set issue reporter using the same method but it is not working with issue watch. The api user have admistrator permissions.

0 votes
Joe Kyle
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 Leaders.
September 17, 2018

Nadun,

As far as I know, and I could be wrong, there is no way to add a Watcher before or while the issue is being created. In other words; the only way I know of adding a Watcher to an issue is to do it manually after the issue is created.  Also, I think the user ID is actually the first part of a users email now. I think, again I could be wrong, Jira will simply default to this and will not let you change it. Hope this helps - But lets see if others in the community agree.

nadunindunil September 17, 2018

Thanks @Joe Kyle 
I am guessing the same thing. let's see if someone has a different answer.

Thank you very much.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events