Getting last_status_or_milestone_change date using API

46 views
Skip to first unread message

Srilaxmi Challa

unread,
Apr 14, 2016, 5:05:45 AM4/14/16
to Assembla API Development
Hi , For a report , I need to get the last_status_or_milestone_change  Date for a given ticket using powershell script.

Assuming that this is the Updated_At field of Status Object ,  I have been trying to get the Status object , using below API ( where Ticketid here is ID field of ticket object obtained from API GET /v1/spaces/[space_id]/tickets/[number] )
 
   $uri = "https://api.assembla.com/v1/spaces/" + $spaceid + "/tickets/statuses/" + $TicketId  
   $StatusDtl = Invoke-RestMethod -URI $uri -Credential $cred -Method Get -Headers $headers

I am getting Error - "The remote server returned an error: (404) Not Found."

Could you please provide below information..

1. Are last_status_or_milestone_change and Updated_At field of Status Object  the same ? Please correct me if I am wrong.
2. To get Ticket status object using API  GET /v1/spaces/[space_id]/tickets/statuses/[id]  , I am getting 404 error , when I pass Ticket ID for [id].  Could you please let me know where I am wrong. I have tried above API with both Ticket ID and Ticket number. Getting same error.

Thanks for your support in advance.

Stanislav Kolotinskiy

unread,
Apr 25, 2016, 2:43:48 AM4/25/16
to assembla...@googlegroups.com
Hi,

1. Nope, they are different.
2. You should use ticket_status_id fetched from Ticket object not ticket ID nor ticket number when fetching status.

Regards,
Stanislav
--
You received this message because you are subscribed to the Google Groups "Assembla API Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to assembla-api-d...@googlegroups.com.
To post to this group, send email to assembla...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Srilaxmi Challa

unread,
Apr 29, 2016, 5:33:08 AM4/29/16
to Assembla API Development
Thanks for the information Stanislav.

* Regarding last_status_or_milestone_change column which we see when we export a ticket to Excel,  could you please let me know how to get this value using API.
I could not find this value in Ticket object obtained using API GET /v1/spaces/:space_id/tickets/<number> ( http://api-doc.assembla.com/content/ref/tickets_show.html )

* Also, ticket_status_id is also not available in the ticket object when above API is used. Could you please let me know where I can find this value?

Thanks again for your support.
Srilaxmi.

Stanislav Kolotinskiy

unread,
May 2, 2016, 1:27:37 AM5/2/16
to assembla...@googlegroups.com
Hi Srilaxmi,

I'm not sure about last_status_or_milestone_change - could you please contact me privately so that we can discuss this?

About ticket_status_id - yeah, my bad, I just rechecked documentation and realized that we are returning a status value, not status id. So basically, in order to figure out when a status (i.e. New) was changed, you need to fetch the list of all statuses via its API and then iterate through the list, find the object that you need, and get its needed data. Please let me know if that helps.

Regards,
Stanislav
--
Reply all
Reply to author
Forward
0 new messages