Hello
I wanted to add an asset via API to a Service Request Ticket which the user selects in a custom field in our Service Request Item.
When reading the requested items via https://XXX.freshservice.com/api/v2/tickets/XXX/requested_items.json I get this:
{
"requested_items": [
{
"custom_fields": {
"request_type": "Replace old device and order a new one",
"manger_new_employee": null,
"date_of_entry_new_employee": null,
"comment_new_employee": null,
"select_your_old_computer": 52000100785,
"what_should_happen_with_the_old_device": "Buy for private use",
"manager_replace_device": 52000148148,
"comment_replace_device": "TEST ORDER! do not delete!"
},
"id": 52000078156,
"created_at": "2022-11-03T13:58:41Z",
"updated_at": "2022-11-03T13:58:41Z",
"quantity": 1,
"stage": 1,
"loaned": false,
"cost_per_request": 0.0,
"remarks": null,
"delivery_time": null,
"is_parent": true,
"service_item_id": 157
}
]
}
As you can see “Select_your_old_computer” is giving me the ID of the asset.
Now if I understood the API documentation correctly, to update the ticket with this asset I need the Display_ID!
Now HOW can I search for this assets details to add it if I cannot search by ID but also only Display_ID??
/api/v2/assets/[display_id]
also I am open if you have any other ideas on how to solve this..
icon
Best answer by zachary.king 11 November 2022, 15:32
View original