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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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.

2 answers

2 votes
Prince N Atlassian Team Sep 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

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.

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.

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
Community showcase
Published in Jira Service Management

Atlympic Event: Jira Service Managemnt

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

47 views 0 0
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you