Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Assign to issue by REST API, then timeout exception

Gerard Jaryczewski (Sygnity) March 12, 2018

I cannot find a reason of timeout exception when updating an issue using REST API and PUT method. The similar code in VB.NET, which successfully updates e.g. summary, cannot updates assigne or add new comment. After 1 minute the TWebException is raised.

Works:

"{ ""update"" : { ""summary"" : [{""set"" : """ & pstrSummary & """}] } }"

Works:

"{ ""update"" : { ""description"" : [{""set"" : """ & pstrDescription & """}] } }"

Doesn't work:

"{ ""update"" : { ""assignee"" : [{""set"" : {""name"" : """ & pstrAssigned & """}}] } }"

Doesn't work:

"{ ""update"" : { ""comment"" : [{""add"" : {""body"" : """ & pstrCommentText & """}}] } }"

The stack trace:

System
w System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
w System.Net.HttpWebRequest.GetRequestStream()
w JiraRestClient.Examples.JiraClient.Assign(String pstrIssueKey, String pstrAssigned) w <path>
System.IO.Stream GetRequestStream(System.Net.TransportContext ByRef)

 

1 answer

1 accepted

1 vote
Answer accepted
Alexey Matveev
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.
March 12, 2018

You should set assignee like this

"fields": {"assignee": { "name": "homer" }}

and you should add comments using

POST /rest/api/2/issue/{issueIdOrKey}/comment

Gerard Jaryczewski (Sygnity) March 13, 2018

Thank you, Alexey. I will recognize my error: I was thinking of a new comment like as a result of an issue update - but my examples was updates of assignee and comment, not additions to issue. Hava a nice day!

Gerard Jaryczewski (Sygnity) March 13, 2018

BTW, why the API responds with a timeout, not with an error? It's interesting.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events