Below is the code for that.
Language: Python
Create an automation script with Action Launch Point with above mentioned code and run as escalation for the assets that need to update the asset description.
from psdi.server import MXServer
from psdi.mbo import MboConstants
assetSpecSet = mbo.getMboSet("ASSETSPEC")
assetSpec = assetSpecSet.moveFirst()
classstructure = assetSpec.getMboSet("CLASSSTRUCTURE").moveFirst()
assetcat = MXServer.getMXServer().lookup("ASSETCATALOG")
description = assetcat.generateDescription(classstructure, assetSpecSet)
mbo.setValue("DESCRIPTION", description, MboConstants.NOACCESSCHECK)
mbo.getThisMboSet().save()
No comments:
Post a Comment