Start a new topic

Setting due_date over API

I'm creating a ticket over API and set a custom due date via due_by (this is listed in the API documentation). But the ticket I created doesn't has the custom due date, but rather the default, set by the SLA.


Updating the due date afterwards also doesn't work.

Here is the JSON: '{"helpdesk_ticket": {"due_by":"2017-07-11T18:00:00+02:00"}}


What do I need to do, when I want to set a custom due date over API?


Best regards,

Lennart

Hi Lennart,


Thanks for reaching out.


In order to update the due_by field of a ticket, we would need to first set the Manual due by as true and then update the due_by and frDueBy( first response due by)


We would need to follow the below steps:


Step 1: Set manual_dueby to true via Update a ticket API


Request uri: /helpdesk/tickets/[ticket_id].json

Request Method: PUT


Sample Code: 


curl -u username@yourcompany.com:password -H "Content-Type: application/json" -X PUT -d '{ "helpdesk_ticket":{ "manual_dueby":true}}' https://domain.freshservice.com/helpdesk/tickets/1704027.json


Step 2: Set due_by and frDueBy via Update a ticket API


Request uri: /helpdesk/tickets/[ticket_id].json

Request Method: PUT


Sample Code:


curl -u username@yourcompany.com:password -H "Content-Type: application/json" -X PUT -d '{ "helpdesk_ticket":{ "due_by":"2018-01-12 20:00:00+5:30","frDueBy":"2018-01-01 15:00:00+5:30"}}' https://domain.freshservice.com/helpdesk/tickets/1704027.json


We are updating the manual_dueby and frDueBy because we are changing the Due date by overriding the SLA policy for the ticket.


Please do try the above steps and let us know if that works.


Looking forward to your reply.


Also, reach out to support@freshservice.com for any further assistance with Freshservice.


Thanks,

Rajagopal

Hi, this code has been working for me, when I created a ticket.


Unfortunately the same method doesn't seem to work for updating.

I tried both sending "manual_dueby" first and then the new date with a second request

I also tried sending "manual_dueby" and the new date in the same request.


The effect is always, that the ticket has the same due date as before.


Would be great, if we could find a solution.


Best regards

Hi Lennart,

Sorry for getting back a little late, if you are still facing this issue, I suggest you try the following API.

curl -v -u user@yourcompany.com:test  -H 'Content-Type: application/json' -X PUT -d '{ "due_by": "2020-01-14T13:08:06Z" }' 'https://domain.freshservice.com/api/v2/tickets/1'

For more details, visit http://api.freshservice.com/v2/

Happy Holidays!!

Thanks,

Jayesh

Login or Signup to post a comment