Search

Update ticket to mark as resolved

Subscribe to Update ticket to mark as resolved 2 post(s)

 
benAT

Hi, can anybody tell me the URL and request body to send for updating a ticket using the Unfuddle API? My code below simply creates a new ticket, ignoring the id attribute within the XML. Thanks.

string fullUrl = BaseUrl + “projects/7/tickets/”;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(fullUrl);
request.KeepAlive = false;
request.ProtocolVersion = HttpVersion.Version10;
request.Method = “PUT”;

// Create the string you want to post to the service
var str = @"<?xml version=""1.0"" encoding=""utf-8""??>581API Test UpdatedDescription";
byte[] postBytes = Encoding.ASCII.GetBytes(str);
request.ContentType = “text/xml; encoding=‘utf-8’”;
request.ContentLength = postBytes.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
var response = (HttpWebResponse)request.GetResponse();

 
David C.

It is not possible to create a ticket with a “PUT” request. If a ticket is indeed being created you are unintentionally doing a “POST” to “…projects/7/tickets/”. Also, you should be sure that you are using the ticket’s ID in the request body as opposed to the ticket’s number.

For your reference the URL to update the ticket in project 7 with the ID 58 is as follows:

http(s)://yoursubdomain.unfuddle.com/api/v1/projects/7/tickets/58

The request body will only need to contain the fields you wish to change. To update a ticket’s priority, summary and description the request body would look something like the following:

1API Test UpdatedDescription