Update a Ticket Status

23 views
Skip to first unread message

mark.w...@site1001.com

unread,
Jun 12, 2017, 5:59:58 PM6/12/17
to Assembla API Development
I had a question about the examples, provided here:


Given the generic example:

curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"status":{"name":"New status",...}}' https://api.assembla.com/v1/spaces/_space_id/tickets/statuses/_id.json


Mine would look like this:

curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"status":{"name":"Deployed to INTEG"}}' https://api.assembla.com/v1/spaces/SE_Dunn/tickets/statuses/159442953.json


Given that my space name is :SE_Dunn
And the Ticket's id (not 'number') is:  159442953

I am using a powershell REST cmdlet, so my actual URI would differ something like this:

$CustomReportsURI = https://api.assembla.com/v1/spaces/SE_Dunn/tickets/statuses/159442953.json?%7b%22status%22%3a%7b%22name%22%3a%22Deployed+to+INTEG%22%7d%7d
Invoke-RestMethod  -Uri $CustomReportsURI -Headers $Headers -Method Put

My questions, 2 things, 
1) do I need to use URL encoding as shown above in my example, for $CustomReportURI?
2) Is the ,  URL ending before the parameters correct with <TicketID>.json, as 159442953.json ?


 Thanks!
Mark W.

mark.w...@site1001.com

unread,
Jun 14, 2017, 11:41:45 AM6/14/17
to Assembla API Development

when trying this:

MacBook-Pro:$ curl -X PUT   https://api.assembla.com/v1/spaces/SE_Dunn/tickets/statuses/180266053.json   -H 'cache-control: no-cache'   -H 'x-api-key: ****'   -H 'x-api-secret: ***'   -H 'Content-type: application/json'   -d '{"status":{"name":"Deployed to INTEG"}}'

response:

{"error":"Couldn't find TicketStatus with 'id'=180266053 [WHERE `ticket_statuses`.`space_tool_id` = ?]"}


Ultimately, I have to convert this curl example, once I get it working to be used in a powershell script, using Invoke-RestMethod.
Meanwhile I will try the other examples, xml and query varieties...
-mw
Reply all
Reply to author
Forward
0 new messages