I tried to add a watcher to one JIRA issue, but anyway, it returns "bad request".
I can update assignee, comment, labels, .... with the similar code below, only watcher got me.
Thanks in advance.
my code is as below:
public void updateJiraWatcher(string key,string watcherName)
var request = new RestRequest()
{
Method=Method.Post,
Resource = "/rest/api/2/issue/"+key+"/watchers",
RequestFormat= DatFormat.JSon
};
string jsonWatcher ="{\""+watcherName+"\"}"; // "{\"username\":\""+watcherName +"\"}; ** doesn't work too
request.AddParameter("application/json",jsonWatcher,ParameterType.RequestBody);
var response = GetRequestsResponse(request);
}
Community moderators have prevented the ability to post new answers.
Hello!
I think that your syntax is slightly wrong for the watcherName. Take a look at this Answer:
https://answers.atlassian.com/questions/61770
Good luck!
Thanks for reply.
To be honest, I have read Please Help! Got error 400 when trying to add watcher using REST API. lots of times, but no idea. sad.
Could you tell me exactly what is wrong with the syntax of WatcherName?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.