Question

User Information from Custom Service Item Field with Requester Data Source


Userlevel 1
Badge

Hello Fresh Community,

I am looking for a way to use requester data in the workflow automator based on a requester selected from a custom field. Right now, I can only see a way to do this based on requester/requested for and not for any custom fields.

Use Case: I need to send/not send an email based on a users department. It is important that the end user filling the form can select the name of the user as they populate the form as opposed to using the “Requested For” after “placing the request”. This custom field points to the requester table but I can not see a way to expose any of their user information despite referencing the user data.

Any assistance will be appreciated. Cheers.


6 replies

Userlevel 4
Badge +5

Hello, 

 

First you can access custom fields in Service items using this, ( Maybe you have done already ) 
Note: The field in the service item need to be a lookup to all users for this to work 

 Then you need to use API/webrequest and this endpoing https://api.freshservice.com/v2/#view_a_requester to get the department ID of that user. 

Userlevel 7
Badge +12

Hello @MichaelS24, what @daniel.soderlund suggested is a great way to solve this. Would the end user be submitting a Service Request? Or are you looking to have them just submit a support ticket using your standard ticket form?

In either case adding a custom “Lookup” field for users will allow the end user to search for the requester via name and/or email address. Just need to make sure that the user is in freshservice as a requester or agent. Once the end user selects the correct person you can then access the contents of that field using placeholders in your workflow, then as mentioned above use the Web Request node to send a request to the freshservice api to retrieve data for that requester. Use the JSON Parser node to parse the data that comes back and make the requester’s “department” a reachable field in a conditional node before executing your action to send an email to that requester.

One area when I was trying to build this out that I could also use some assistance is how to reference the departments of the requester since that field in the JSON response is an “Array of Numbers”. A list of department IDs when a requester belongs to more than one department. @daniel.soderlund @BrynCYDEF @keefe.andrews Any ideas on how to reference a single ID? 

I love these kinds of challenges!!!

Userlevel 4
Badge +5

Hello @MichaelS24, what @daniel.soderlund suggested is a great way to solve this. Would the end user be submitting a Service Request? Or are you looking to have them just submit a support ticket using your standard ticket form?

In either case adding a custom “Lookup” field for users will allow the end user to search for the requester via name and/or email address. Just need to make sure that the user is in freshservice as a requester or agent. Once the end user selects the correct person you can then access the contents of that field using placeholders in your workflow, then as mentioned above use the Web Request node to send a request to the freshservice api to retrieve data for that requester. Use the JSON Parser node to parse the data that comes back and make the requester’s “department” a reachable field in a conditional node before executing your action to send an email to that requester.

One area when I was trying to build this out that I could also use some assistance is how to reference the departments of the requester since that field in the JSON response is an “Array of Numbers”. A list of department IDs when a requester belongs to more than one department. @daniel.soderlund @BrynCYDEF @keefe.andrews Any ideas on how to reference a single ID? 

I love these kinds of challenges!!!

 

In the JSON read node you can add expression see this page JSON Parser Node : Freshservice
But then you get X id.  What you can also is to use a expression node and regexMatch


Something like this  in a condition or expression node regexMatch(‘{{placeholder_department_ID_array}}’,’Departement ID’)
I haven’t tested it my self but it should work. 
Could be that the array placeholder contains comma and it will break the expression. 
You could use replace in Liquid filter  {{ PH | replace: ‘,’ ‘.’ }} and maybe the remove to remove brackets. 

Userlevel 1
Badge

Thank you both for your responses. Look forward to trying this out later and building my familiarity with Fresh’s Webhook/JSON Parser nodes!

Will more than likely need to pull department out of multiple so will report back on how I go later.

Userlevel 4
Badge +5

Thank you both for your responses. Look forward to trying this out later and building my familiarity with Fresh’s Webhook/JSON Parser nodes!

Will more than likely need to pull department out of multiple so will report back on how I go later.

it’s Web Request node → JSON parser node → Expression Node. 
Webhook far as I understand don’t return any information, it’s a fire and forget action. 

Userlevel 4
Badge +2

Thank you both for your responses. Look forward to trying this out later and building my familiarity with Fresh’s Webhook/JSON Parser nodes!

Will more than likely need to pull department out of multiple so will report back on how I go later.

Hi @MichaelS24 ardently waiting to know your results 🕵.

Also do mark the the solution that worked the best for you. Just hit the “Best Answer” button to let the community know your experience. 

Reply