PUT /v1/spaces/:space_id/tickets/:number
HTTP Verb: PUT
Available statuses: 200 OK, 404 Not Found, 422 Unprocessable Entity
Object: Ticket
Location: n/a
Formats: XML, JSON
Update a ticket
Params
To update a ticket, a data body must be provided. Data can be provided in three formats: XML, JSON and query string. To specify data type of XML or JSON add the Content-type: application/(json|xml) header to request headers, if you want to provide query string simply skip the Content-type header.
All params should be sent in the ticket namespace, e.g.:
XML
<ticket>
<summary>FixMeAgain</summary>
...
</ticket>
JSON
{"ticket":{"summary":"FixMeAgain",...}}
Query string
ticket[summary]=FixMeAgain&...
Check the full list of available params on ticket object fields reference
Examples
For example purposes we use a JSON body
{"ticket":{"summary":"FixMeAgain"}}
Request XML, using cURL utility:
curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"ticket":{"summary":"FixMeAgain"}}' https://api.assembla.com/v1/spaces/_space_id/tickets/_number.xml
Response
HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Wed, 20 Jun 2012 12:13:01 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
...
Request JSON, using cURL utility:
curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"ticket":{"summary":"FixMeAgain"}}' https://api.assembla.com/v1/spaces/_space_id/tickets/_number.json
Response
HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Wed, 20 Jun 2012 12:05:41 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
...
{}
Note: If you want to add a value to a custom field, to identify the custom fields an ID or name should be provided, name should be formatted to match XML, JSON or query string acceptable format, i.e.:
- XML, replace whitespaces with dashes - “Text Field” should be “Text-Field”
Examples of valid custom fields body, considering ID of a custom field is “15” and its title is “Text Field”:
XML:
<ticket>
<custom-fields>
<Text-Field>some value</Text-Field>
</custom-fields>
</ticket>
XML does not support identifiyng custom fields by ID which is an integer, an integer can’t be a valid XML tag
For update operations no response body is available, to get the data of updated resource send a GET request to the same URL, i.e.:
curl -i -H "Authorization: Bearer _token" https://api.assembla.com/v1/spaces/_space_id/tickets/_number.(xml|json)