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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,334
Community Members
 
Community Events
176
Community Groups

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

Atlassian Community Events