Question

Automatically associate assets to incidents

  • 7 July 2022
  • 6 replies
  • 181 views

Userlevel 2
Badge +1
  • Top Contributor
  • 5 replies

Hello FreshService Bods!

 

 Its been asked before (But with no solution) but has anyone worked out how to automatically associate assets to incidents. We have hooked our monitoring product into FreshService and its busy logging tickets but I feel like I’m going backward if I have to ask someone to manually associate the assets ???

 

 I’ve checked supervisor, workflows and alert rules but can;t see an easy way to crack it. We could code it up in PShell but I’m trying to avoid that, any thoughts ?


6 replies

Userlevel 7
Badge +14

Hello @JonO I would try creating a workflow automator to automate that process. There a few ways to do it, but ultimately you could make an API request to the Freshservice API and associate an Asset in that fashion. You will need to find out how you can gain access to the asset ID from the ticket (whether that is a field where that idea is populated, etc) so that you can make the workflow dynamic.

Let us know if you need any further help with that. Take care.

Userlevel 2
Badge +1

Thanks @zachary.king this is what we concluded as well. I was hoping there would be a nice workflow way of doing it but I think as you say it will be picking out those ticket types, running a match on the ‘node’ with a problem to find an asset ID then add the association. 

 

I’m doing it manually just to see the data and I have to say its well worth doing, you can get some reports on assets with the highest number of incidents, although I would much rather a dash which seems to be something missing from the asset side of things!

 

Userlevel 2
Badge +1

Thought I would actually put a conclusion on this one, we managed to complete it ! The workflow has a liquid filter to extract the CI name then uses the api within the workflow to make the association. 

Userlevel 3
Badge +6

Thought I would actually put a conclusion on this one, we managed to complete it ! The workflow has a liquid filter to extract the CI name then uses the api within the workflow to make the association. 

Are you using the API with in the automator? 

@JonO , to be honest i do not understand why you have to do the association in a workflow. In our setup we hooked up various Alertsources to FS Alertmanagement using Custom integrations. Basic approach:

  1. Asset name in “Resource” - field when sending JSON to Custom Alertmanager Webhook
  2. All other relevant info for incident ticket in “additional Info” fields.
  3. Workflow Automation:
    1. Trigger by “Incident raised”
    2. Condition: Incident created by Custom Integration Name
    3. JSON Parser node to extract data from “{{ticket.primary_alert.additional_info}} → your approach using liquid filter works also but why do manual parsing using strings if JSON can be used?
    4. Action node that stores extracted info in Incident

As long as the name of the asset/CI passed in “resource” matches the name in the CMDB, there is no need to to the association manually, FS does this for you (at least in FS enterprise)

Hope that helps. Let me know if you need more details.





 

Userlevel 3
Badge +6

@JonO , to be honest i do not understand why you have to do the association in a workflow. In our setup we hooked up various Alertsources to FS Alertmanagement using Custom integrations. Basic approach:

  1. Asset name in “Resource” - field when sending JSON to Custom Alertmanager Webhook
  2. All other relevant info for incident ticket in “additional Info” fields.
  3. Workflow Automation:
    1. Trigger by “Incident raised”
    2. Condition: Incident created by Custom Integration Name
    3. JSON Parser node to extract data from “{{ticket.primary_alert.additional_info}} → your approach using liquid filter works also but why do manual parsing using strings if JSON can be used?
    4. Action node that stores extracted info in Incident

As long as the name of the asset/CI passed in “resource” matches the name in the CMDB, there is no need to to the association manually, FS does this for you (at least in FS enterprise)

Hope that helps. Let me know if you need more details.





 

 

This is a good way but there is not a option to associate an asset from this automator unfortunately.

 

Our setup is we have a server collecting information from workstations, when an event is logged that meets the criteria a webhook is sent to Fresh service with the info. In the info passed to FS the serial number of the asset is sent. How can I automate that to associate it to the ticket that is created from the alert?  I have followed your JSON parse node but the action node following has no ability to associate the asset. 

Reply