Solved

Asset fields in emails to customers

  • 13 July 2022
  • 8 replies
  • 78 views

Userlevel 3
Badge +3

We have a workflow where we need to notify an external vendor via email that we have sent them a laptop for repair. The email they receive needs to have the name of the officer who logged the incident, a description of the problem with the laptop, and the serial number of the laptop we have sent to them. 

I can get all the fields out of the system, except the associated asset’s serial number. There is an associated asset name we can include, but we don’t seem to be able to output any other asset fields. 

How would we get the serial number, or any other asset field, to populate into the email template?

icon

Best answer by zachary.king 13 July 2022, 15:20

View original

8 replies

Userlevel 6
Badge +9

Hello @Chris Sherlock 

You need to use API call using  a webrequest node and a JSON node to get that. 
https://api.freshservice.com/v2/#view_an_asset

/api/v2/assets/[display_id]?include=type_fields

Userlevel 7
Badge +14

Hello @Chris Sherlock 

You need to use API call using  a webrequest node and a JSON node to get that. 
https://api.freshservice.com/v2/#view_an_asset

/api/v2/assets/[display_id]?include=type_fields

Perfect solution, and then @Chris Sherlock you can reference the specific field from the requested Asset using the JSON Parser and then use that field as a placeholder in your email.

Userlevel 6
Badge +9

Here is a example https://support.freshservice.com/en/support/solutions/articles/50000003705-web-request-node how to use them. 

Something missing is the new test function in the new web request node. Much easier to setup the JSON parser. 

Userlevel 3
Badge +3

@daniel.soderlund and @zachary.king I had no idea you could so any of that! That’s fantastic - it looks exactly like what I need!

Userlevel 3
Badge +3

I was wondering if anyone might be able to help a bit further - had do you authenticate via the web request node to Fresh’s v2 API? I have an API key, but not sure what to choose for Key and Value if you choose authentication as API key…  

 

 

 

Userlevel 3
Badge +3

It’s OK, I just answered my own question. You don’t pick API Key, instead you choose Basic Authentication, enter the API key you generate from Fresh as the username and the password is “X”. 

Userlevel 6
Badge +9

Hello,
If you haven’t found it here you have the JSON node JSON Parser Node : Freshservice
Do a test in the  webrequest and copy the answer you get back into the JSON Parser node. 

After that you get all the values as placeholders. 

Userlevel 7
Badge +14

It’s OK, I just answered my own question. You don’t pick API Key, instead you choose Basic Authentication, enter the API key you generate from Fresh as the username and the password is “X”. 

I admit, this was so confusing to me when these options were made available 🤣

Reply