Freshservice Hack: Adding Agent Details to Private Notes in Freshservice Using API Calls

Keeping track of internal notes in Freshservice can be challenging when you need to know who left each note. With a few customizations using API calls, you can enhance your workflows to automatically include the agent's name in private notes. This blog post provides a step-by-step guide to setting up a workflow that captures the agent's ID, retrieves their name, and adds it to the private note details.

Check out our video tutorial here: Watch on YouTube

Why Include Agent Names in Private Notes?

Adding agent names to private notes helps teams track who posted specific notes, improving transparency and accountability in ticket handling. This is especially useful for long-running tickets or complex cases where multiple agents may collaborate.

Solution Overview

In this solution, we’ll use API calls to capture the ID of the agent who posted a private note, retrieve their name, and automatically insert it into the note. Here’s a quick breakdown of the process:

  1. Capture the conversation details to get the ID of the person who posted the private note.

  2. Use an additional API call to retrieve the agent's name associated with the ID.

  3. Insert the agent’s name into the private note, providing clear context in each note.

Step-by-Step Instructions

Step 1: Set Up the Workflow Trigger

  1. Go to Admin Settings > Workflows > Automations.

  2. Configure the workflow to trigger whenever a private note is added to a ticket.

Step 2: Capture the Agent’s ID from the Note

  1. In the workflow, add a step to capture the ticket conversation.

  2. Parse the conversation details to isolate the agent's ID.

    • Tip: Ensure that the array parser correctly targets the ID field to identify the agent who posted the note.

Step 3: Retrieve the Agent’s Name Using an API Call

  1. Use a second API call to request the agent’s name based on the ID.

    • Format the API request to retrieve the “first name” and “last name” fields of the agent.

  2. Test the API call to confirm it returns the agent’s full name as expected.

Step 4: Add the Agent’s Name to the Note Content

  1. Modify the workflow to insert the retrieved agent name into the note.

  2. Structure the note as needed, such as:

    • “Note posted by [First Name] [Last Name]”

  3. Test the workflow by adding a private note to a test ticket. Confirm that the agent’s name appears as intended.

Troubleshooting Tips

  • ID Mismatch Issues: Freshservice sometimes assigns different IDs to users who were initially requesters and later converted to agents. To verify, check the agent’s ID by accessing the ticket in API view.

  • API Call Errors: Ensure that the JSON format and request syntax match Freshservice’s requirements, as formatting errors may cause the request to fail.

For a complete demonstration, watch our video tutorial: Watch on YouTube.

Final Thoughts

Using API calls to automate agent detail insertion into private notes can significantly improve internal communication and accountability within Freshservice. This solution is ideal for teams who handle complex or high-volume tickets and need clear records of each agent’s contributions.

Previous
Previous

Adding a BCC to Freshservice Reply Notifications Using Webhooks and API Calls

Next
Next

Time Format Validation in Freshservice: A Simple Workaround with Business Rules