See relevant discussion with Freshservice Product Specialist below re: potential solution using workflow settings...
Rishikesh L, said 3 hours ago
Hi Christopher,
I wanted to let you know that the proposed solution is indeed viable and can be integrated into the workflow using the Web Request node. I suggest following the outlined steps in the community as they are very clear.
Let me refine it for you.
Step 1: Use the Web Request node with the following settings:
- Request type: GET
- Endpoint: https://mycompany.freshservice.com/api/v2/requesters/{{ticket.requester.id}}
Step 2: Utilize the JSON Parser node and set the Web Request response body as the source.
You can take a look at the following documentation to know how you can invoke a web request and save the response as JSON Parser :- https://support.freshservice.com/support/solutions/articles/50000003612-sample-usecase-invoking-a-web-request-and-parsing-its-response-using-the-json-parser-node
Step 3: Implement a Condition node to check if requester.is_agent is “true.”
Next, create two Web Request nodes after the “is_agent” condition:
If the requester is an agent:
- Request type: POST
- Endpoint: https://mycompany.com/api/v2/relationships/bulk-create
- Body:
{
"relationships": [
{
"relationship_type_id": 52000081231,
"primary_id": {{ticket.requester.id}},
"primary_type": "agent",
"secondary_id": 13,
"secondary_type": "asset"
}
]
}
If the requester is not an agent:
- Body:
{
"relationships": [
{
"relationship_type_id": 52000081231,
"primary_id": {{ticket.requester.id}},
"primary_type": "requester",
"secondary_id": 13,
"secondary_type": "asset"
}
]
}
Please note that the “relationship_type_id” should be the actual ID of the relationship you want to create, while the “secondary_id” is the display ID of the asset, not the actual ID. To find these IDs, use a Web Request (GET) nodes with the endpoints `/api/v2/assets` and `/api/v2/relationship_types`.
If you need any more assistance, feel free to ask!
Check your ticket status - https://support.freshservice.com/support/tickets/17613043
Rishikesh L
Product Specialist
support@freshservice.com

Explore our products
Chat with us for quicker resolution
Christopher L, said 3 minutes ago
Great! I will follow-up with our system admins to see if they can help me implement the potential workflow solution. Regardless, I still think it is worthwhile to suggest the automation of this as a feature request that would be beneficial for all stakeholders working with Asset Management. Thank you again for you time.