Jim Posted June 9, 2023 Share Posted June 9, 2023 Hi all, Hopefully I can share this here. I have built a tool in my spare time with a GUI running off the back of the library here GitHub - hornbill/pythonApiLib: Python Library for making xmlmc calls it allows for updating user, sub states, and linking to references, the asset states are automatically updated based on a chosen substate, also creating assets. This has come from our particular use case where when assets are purchased we create a basic record of the asset and let the import scripts take over when a device has been built. One thing I think some of you may be interested in is the ability to bulk update assets, I allow this in this tool based on a csv of either asset ID (recommended) name or asset tag. This should also help to empower some of your users who don't necessarily have the permissions to make script changes just for one bulk update. When I release to git hub I will post the link here however posting now as I would love to know what other relevant fields people may be interested in updating via this method. I have kept it short and simple for now and not added many fields to update as most should be handled by the automated scripts but it would be great to get some insight into what may be required before publishing an initial version. Link to comment Share on other sites More sharing options...
Jim Posted June 9, 2023 Author Share Posted June 9, 2023 here's some screenshots for reference - This is very early days so far Link to comment Share on other sites More sharing options...
Victor Posted June 9, 2023 Share Posted June 9, 2023 @Jim interesting and this is definitely a first ... While I do not want to temper the enthusiasm here, it would be good to see what APIs you make use of in this tool. Our API documentation is not really geared for this type of development (we have a new, better one being developed but this is WIP). It can be used, of course, but unless one is familiar with some underlying aspects of how HB works then is not very straightforward to make use of APIs in this way. The reason why I am asking about APIs is that we would need to ensure we don't end up with "broken" data, which would look ok on paper but in fact, is not entirely correct. For example, if your tool is making use of application APIs (e.g. com.hornbill.servicemanager::Asset/updateAsset2) then we should be ok (in theory) but if you use data APIs (e.g. data::entityUpdateRecord or data::updateRecord) then it can be a bit problematic as they work in a certain way (update one or a set of records in a specific table) and more would need to be done in terms of updating data to ensure related data, for example, are also catered for. If you use, for example, data::entityUpdateRecord for the assets table (and only this), your asset will look ok when you look at it in the asset UI but it might be broken in other areas because the asset related data is missing. On GitHub we have an asset import (and update) tool: https://github.com/hornbill/goDBAssetImport which can be used as a reference to see how we do the create and update of assets. It is possible you already looked at this but if not, it would be a good idea to have a look a the code. Link to comment Share on other sites More sharing options...
Jim Posted June 13, 2023 Author Share Posted June 13, 2023 Hi Victor, Thank you for responding. I do use the updateAsset2 method for this, The api documentation was lacking in some areas so I was doing these tasks from within Hornbill directly and checking the payload sent to reverse engineer it's use. I'm not too far off having the basics complete to release the code now, so I would appreciate it if you could let me know of any concerns or issues when I do Link to comment Share on other sites More sharing options...
CraigP Posted June 14, 2023 Share Posted June 14, 2023 Hi @Victor Can you please give specific examples of where related data might be broken when using data entityUpdateRecord? I use this to automate updates to assets in bulk e.g. a mass movement of stock process where many laptops need to have their used by attribute cleared and their location, site and state/substate updated. This has been in place for a few years now and I haven't noticed anything amiss, but as you say, maybe things look fine in the Asset Manager section and Assets tables but something else is wrong? Link to comment Share on other sites More sharing options...
Nikolaj Posted June 15, 2023 Share Posted June 15, 2023 HI @All I like that idea of an Asset Bulk Update tool. Because i was asking for that a long time ago. It would make really sense to have some official from Hornbill. And it seems that are more customer interested in this or doing something by their own for this kind of action in hornbill. Thanks and best regards Nikolaj Link to comment Share on other sites More sharing options...
Steve Giller Posted June 15, 2023 Share Posted June 15, 2023 1 hour ago, Nikolaj said: It would make really sense to have some official from Hornbill https://wiki.hornbill.com/index.php?title=Asset_Data_Import_Tool Link to comment Share on other sites More sharing options...
Jim Posted July 13, 2023 Author Share Posted July 13, 2023 Hi all, I have created a pre release for this for anyone interested to have a look into, hopefully it can be seen as a useful tool, I would greatly appreciate any feedback from anyone and if anyone is interested in seeing the source code and potentially contributing I am happy to share my private repo. Tags · JimParton96/Hornbill-Public · GitHub Link to comment Share on other sites More sharing options...
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