Solved

Fields can be updated using Update a Ticket API

  • 13 December 2021
  • 2 replies
  • 196 views

Badge

Hi,

I am exploring the possibility to update a new ticket’s due by using Update A Ticket API, document for the related API as below:

https://api.freshservice.com/v1/#update_ticket_priority

 

May I know if all fields of a ticket can be updated by using this API? Cause I tried priority field, and it is updated successfully, but it doesn’t work for due by.

 

Regards,

Roland Ng

icon

Best answer by rajagopal.baladhandayutham 14 December 2021, 04:42

View original

2 replies

Userlevel 4
Badge +5

Hi Roland,

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 url: /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 url: /helpdesk/tickets/[ticket_id].json

Request Method: PUT

Sample Code:

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

 

You can also try the steps using our API v2 documentation here

Thanks.

Badge

Thanks Rajagopal, I have a another issue about the API:

 

My case is to update ticket’s due by date using the value of a custom date time field from the service request, let say the case is that the custom date time field is set as “31-Dec-2021 00:00”, after saving the service request, the due by date will be updated as “31-Dec-2021 08:00” as the system time zone is GMT+8 and the custom date time field has no time zone information so it is default as GMT+0.

 

May I know if there are any way to add time zone information to the custom date time field or other alternatives?

Hi Roland,

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 url: /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 url: /helpdesk/tickets/[ticket_id].json

Request Method: PUT

Sample Code:

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

 

You can also try the steps using our API v2 documentation here

Thanks.

 

Reply