Question

User Information from Custom Service Item Field with Requester Data Source

  • 21 June 2022
  • 8 replies
  • 892 views

Userlevel 3
Badge +4

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.


8 replies

Userlevel 7
Badge +13

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 +16

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 7
Badge +13

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 3
Badge +4

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 7
Badge +13

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 5
Badge +3

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. 

Userlevel 4
Badge +8

but seriously… I question the decision of the developer team from FreshService to:

  • not implement a Reader node option like for Assets to easy up the process
  • to only implement a tiny tiny tiny fraction of fields available to choose from in the action node. Why not have ALL fields there straight away??

 

Why making it extra hard for us? To get the Department as a “Name” you need 5 steps!!

Please freshworks.. improve this...

Userlevel 7
Badge +13

@msconfig87 It’s not only place they need to add more placeholders. 

But some of them are popping up but not showing in the GUI. 

Reply