Skip to main content

I appreciate that a lot of assets have a fixed location; however as a company primarily using laptops, we’d like a way to auto assign the location of the laptop based on the Used By users location.

 

We can easily identify the what is a laptop as far as workflow is concerned but cant come up with the webhook that would read the users location_id and put it in the asset’s location_id.

 

Any ideas appreciated.

 

Many thanks in advance

Was there ever a solution for this?


Also looking for a solution to this!!


@8i5i8 Not an expert we do have the location change dynamically for laptops, however it does require the discovery agent/intune.

 

If you’ve got an internal ip range that isn’t common like “192.168.1.*”, then what you can do is do a workflow which runs when an ip address is updated. Add a condition for if the IP address starts with “192.168.10” then set the location.

 

Obviously this is not foolproof as you’d have cases where users might stumble into a network within your ranges.

----

I think there might be a way of doing editing the location of the asset based on the used by user’s location via webhooks. Through thought about how it might be done.

  1. Create workflow (scheduled hardware)
  2. Do a web request and view a requester, use the “Used By” as the reference in the endpoint
  3. Add a json parser and take the response from the previous step
  4. Make a post web request (update an asset), and add the placeholder for the location id in the body, you’d need to include so other parts of the body. That should update the location to the right one. (Service Desk API for Developers | Freshservice)

If the used by isn’t actually the user ID then you’d have to do “Filter Requesters) and get the ID that. Sometimes you’d end up with single quotes covering the id’s etc, so you’d need to trim the result to use in the next steps, albeit I’m not sure when that happens.

 

Hope this helps.


Thanks for the suggestion. 
we solved this with an automation using the api via a request to lookup the location of the “used by” user and write it back to the location of asset.  We just run it on a schedule and update all the assets once a week. 


Thanks for the suggestion. 
we solved this with an automation using the api via a request to lookup the location of the “used by” user and write it back to the location of asset.  We just run it on a schedule and update all the assets once a week. 

 

So, I am not familiar with writing API’s syncs yet. Can you give me a brief overview of what you did? This would be SUPER helpful given that we also have laptops ALL over the globe, and would love to sync location. We store location in the user info in Azure and the city and stuff shoes up because we SYNC azure.


Reply