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

Jira - Add watchers to an issue using Rest API

jag kap August 28, 2015

I am trying to add watchers to an issue using the JIRA  REST API.

I have tried the following

try:
data = "\"admin\""

headers = {"Authorization": " Basic " + b64encode(username + ":" + password), "Content-Type": "application/json"}
request = Request('https://_****_.atlassian.net/rest/api/latest/issue/MISC-1/watchers', data=data , headers=headers)
js_res = urlopen(request)
objResponse = load(js_res)
print objResponse
except urllib2.HTTPError, error:
print error.read()

 

I have tried different ways but nothing worked.

Can Someone please help me with this????

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Taha Khanzada
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.
August 28, 2015

Hi Jag,

Try this CURL command,

curl -i -u username:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '"jirausername"' https://_****_.atlassian.net/rest/api/latest/issue/MISC-1/watchers -k

Taha

TAGS
AUG Leaders

Atlassian Community Events