Jump to content

goDBassetimport - Need to load new Assets in as "Active" not "Current"


Recommended Posts

Good morning,

We've been using goDBassetimport to import/update assets from SCCM for a while now, however users have been frustrated that Assets come over as "Current" and having to manually change it 
(in our Organisation, "Current" means nothing to us, so we use "Active" and "Archive" along with Substates, at least, until hopefully one day, we get the ability to configure our own Asset States).

Anyway, we need any new Assets not currently in Hornbill to come in with a State of "Active".  If the Assets already exist, then we need to preserve the Asset State and Substate to what they are now, so the Import doesn't override it.  I noticed this when I did a test on a couple of archived assets a week or so ago, by including h_record_state in the JSON file - these archived assets States were changed to Active (I've since changed them back).

Thanks,

Samuel

  • Like 1
Link to comment
Share on other sites

Hi @samwoo,

Would an "Action" selection of "Create", "Update", "Both" be of use to you? i.e. you could then have one configuration file to use for creating assets (i.e. when the script doesn't find an asset to update and hence creates the asset), and another file to be used for updating existing assets (and not bother importing new items). "Both" would be the default/current behaviour of creating when not found, update otherwise.

If so, I can likely add that functionality by the end of this week.

Link to comment
Share on other sites

46 minutes ago, SamS said:

Hi @samwoo,

Would an "Action" selection of "Create", "Update", "Both" be of use to you? i.e. you could then have one configuration file to use for creating assets (i.e. when the script doesn't find an asset to update and hence creates the asset), and another file to be used for updating existing assets (and not bother importing new items). "Both" would be the default/current behaviour of creating when not found, update otherwise.

If so, I can likely add that functionality by the end of this week.

Hi @SamS,

Yes, that would be brilliant - running two configurations does make it ideal as it would also allow producing two log files as well.

Thanks!

Samuel

Link to comment
Share on other sites

Hi @samwoo,

I've just released v1.11.0 of the DB Asset Import Tool, that supports preserving Status/SubStatus/Operational Status values for updating assets. Can be downloaded from here:

https://github.com/hornbill/goDBAssetImport/releases/latest

Check out the new PreserveStatePreserveSubState and PreserveOperationalState options in the AssetTypes definitions.

Setting the Status to Active when assets are inserted is alredy possible, you just need to add:

"h_record_state": "1",

To the AssetGenericFieldMapping.

Cheers,

Steve

 

  • Thanks 1
Link to comment
Share on other sites

Hi @samwoo,

I didn't notice the Create/Update/Both request when doing the PreserveState etc feature, so I've added that into the tool, v1.12.0 contains that feature :) 

https://github.com/hornbill/goDBAssetImport/releases/tag/v1.12.0

Check out the OperationType property of the AssetTypes objects, you can set them to BothCreate or Update. Leaving the parameter blank (or indeed not even including it) will perform the previous logic (so Both :) ).

Cheers,

Steve 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

@Steve G and @SamS,

For the Update operation, is it possible to make it so that it only updates the asset if there have been any changes?  I've noticed even if the fields are all the same value, the Asset will still say "Last Updated" at the time the Import process is run... which isn't correct as nothing has changed.
image.png.ec0dcbfea1d9fd63a0f78b5070124333.png

image.png.423497d125b54499ca736b3be141b8db.png

And looking at the Asset fields directly - they are exactly as they have always been.

Thanks,

Samuel

Link to comment
Share on other sites

Hi @samwoo,

Yes, this will likely require a fair amount of work to achieve - I expect we'll need to cache all asset and extended information records from Hornbill into memory tool-side, then check each of the assets being imported against that cache. It's been on the to-do list to add this feature for a while though... I'll take a more detailed look in the new year and get back to you.

Cheers,

Steve

  • Thanks 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...