API Update Ticket with Service Request

  • 24 October 2018
  • 6 replies
  • 136 views

If I want to update a Service Request item.


with the following


@"

{

"priority" : 1,

"status" : 2

}

"@


But when I run my code I get this....

Invoke-RestMethod : {"description":"Validation failed","errors":[{"field":"type","message":"It should be one of these values: 'Incident'","code":"invalid_value"}]}

At


I don't want to update the "type" field because it is already set to
"type": "Service Request", if I change this to "type": "Incident",
It works but lose all information on the Item.
If I add "type": "Service Request" to the code it does not work....


Does someone know how to bypass the error.... Or another workaround?
@Freshplease update you're API....



6 replies

Hi Sjoerd,


Looks you are using API V2 to update a Service Request and it fails as API V2 doesn't support Service items. We are enhancing the API V2 across all the modules and should be available in the nearest updates. You can make use of API V1 for Service items. 


Hope this sounds helpful. 

Hello


I just tried to update a Service Request like Sjoerd. I cannot use API V1 and V2 doesn't support this function still.

Is there any Update?


Thanks.


I am having an issue with Service Requests as well in V1.  Have a ticket opened.   If I find anything out I will share it here.


Hi Sid,

I hope we were able to help you over the ticket. It looks like you'd like to update the ticket field property for a service item and this can be accomplished through API Version 1 and the Service item API V1, will help you to modify/update the custom fields of the service item.

Let's say if you'd like to update a service item's ticket property, then you can use the below query,



curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "helpdesk_ticket": { "priority":1, "status":2 }, "custom_field":{"fieldname_67135":test}}' https://domain.freshservice.com/helpdesk/tickets/1.json

If you like to update a custom field of that specific service item,

curl -u APIKEY:X -H "Content-Type: application/json" -X PUThttps:// domain .freshservice.com/catalog/request_items/4/purchase_order.json -d'{"requested_item_values":{"4":{"item_id":"3000282076","quantity":"3"},"12":{"item_id":"3000282084","requested_item_value_attributes":{"3000282084":"patrick jane"}}},"requested_for": "thushan@netflixdesk.com"}'


I hope this helps.


Thanks for using Freshservice!


Thanks,

Vaishali

Hello,
I would like to follow up on this question:

  1. As of today (05/21/2021), I’m also experiencing the same problem with V2: I can neither update nor create a ‘Service Request’; it only allows to do it using a request type of ‘Incident’
  2. Using an API request. I would like to update “request_item_values” of a specific ‘Service Request’
    Notes:
    1. On the browser, I can access the specific request form at (to submit a new request):
      domian/support/catalog/items/<catalog_number>/
    2. On the browser, I can see the specific service request at:
      domain/helpdesk/tickets/<service_request_number>#requested_items
    3. I’m able to update the general information about the ticket using the following api url:
'https://domain/helpdesk/tickets/' + <ticket_id> + '.json';

                 4. I’m able to retrieve ‘requested_item_values’ using the following api url:

'https://domain/helpdesk/tickets/' + <ticket_id> + '/requested_items.json';


I looked at the API url of the example above from Vaishali

https://domain.freshservice.com/catalog/request_items/4/purchase_order.json

but the following does not work

/catalog/request_items/<catalog_number>/<ticket_number>.json

 

 

What would be the api url for updating “request_item_values” of a specific ‘Service Request’?

 

Thanks!

Laura

Userlevel 3
Badge +6

Hi Laura,

Currently we don’t have an API that supports updating the requested_items section of a service request. You can update the common ticket fields using API v1 but not the custom fields inside requested items.

Warm Regards,
Sanofar
Team Freshservice

Reply