Skip to main content

Inside a workflow, I have trigger: “Requested item added is”, and I am checking it. Later on, I need the ID of that Requested item that has been just added. How can I get it? I can only get the ticket, the Service Request ID.

The ideal will be when a new Requested item is added, I want the id.

You need to use the API endpoint https://api.freshservice.com/v2/#view_req_items_of_sr

 

 


Inside a workflow, I have trigger: “Requested item added is”, and I am checking it. Later on, I need the ID of that Requested item that has been just added. How can I get it? I can only get the ticket, the Service Request ID.

The ideal will be when a new Requested item is added, I want the id.

Remember this will only work if a agent adds a item and not when requester place a request. 


@Daniel Söderlund Well, I want to get the ID of the last Requested item added to a Request. Now I can get all the data in JSON, but I need the ID of the last one added item. It seems I need to iterate over array, but for now freshservice doesnt support such things. And I was curious If I can get it somehow. Or If i can use in workflow like $.requested_itemst1].id, where 1 is the ID I need but I dont know the index I need there is no arr.length-1 for example...


@Daniel Söderlund Well, I want to get the ID of the last Requested item added to a Request. Now I can get all the data in JSON, but I need the ID of the last one added item. It seems I need to iterate over array, but for now freshservice doesnt support such things. And I was curious If I can get it somehow. Or If i can use in workflow like $.requested_itemst1].id, where 1 is the ID I need but I dont know the index I need there is no arr.length-1 for example...

 

 $.requested_itemsd-1:].id gives you the last one 


@Daniel Söderlund The thing I needed! Thank you very much! :)


@Daniel Söderlund The thing I needed! Thank you very much! :)

Remember to subscribe, like and comment… ops wrong platform but you get it ;) 

Mark the thread as solved :)