Gareth Cantrell Posted July 2, 2024 Posted July 2, 2024 During a leaver workflow, I want to clear the "Owned By" and "Used By" fields of the linked assets. In the "Update All Assets - General Information" automation, I can successfully clear the "Used By" field by selecting "Manual" and leaving the user selection empty. However, this does NOT work for "Owned By", in fact the "Owned By" field only shows full users and doesn't give an option for selecting user types (User, Basic, All) like the "Used By" field.
Jim Posted July 2, 2024 Posted July 2, 2024 Try -1, just a guess but some null values especially when using a list or ID are -1 in Hornbill
Gareth Cantrell Posted July 4, 2024 Author Posted July 4, 2024 Unfortunately, setting the field to "Variable" and and the parameter to -1 causes an error in the workflow. Basically, it is not currently possible to un-assign an owner from an asset, other than doing so manually.
Steve Giller Posted July 4, 2024 Posted July 4, 2024 -1 was never going to work - it's not an empty value, it's not a valid User, and it's definitely not a "null" value. This is being looked at internally, it appears at first review that currently only Owned By can be cleared in this way.
Gareth Cantrell Posted July 4, 2024 Author Posted July 4, 2024 I thought I'd try the "-1" on the off chance that it worked (one never knows ) The only way I've managed to workaround it for now is by doing the following: Update an asset field we're not currently using Setup a webhook that calls an Azure Logic App when an asset is updated with that field set In the Azure app, call back to a Hornbill Auto-task In the auto-task, check for the "hidden" field and then using the experimental HTTP Cloud Automation node, call the Assets:updated2 API to with the following JSON string (encoded in the "generalParameters" attribute: [{"name":"ownedById","value":""},{"name":"ownedByName","value":""},{"name":"ownedByType","value":""}] It's a bit long-winded, but it works.
Berto2002 Posted July 5, 2024 Posted July 5, 2024 Following. Our approach to this issue was to never to leave an asset "unused" so we have 'dummy' users in the database to whom we assign such as below. Also helps avoid ambiguity as to why any given asset has no owner.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now