Hello,
I am currently trying to come up with a clever solution to take a Configuration Item's "Primary Asset Owner" and expose it in CMDB. There are a multitude of challenges around this currently and I am hoping someone might have some insights that can help me make something happen. Right now we have a Data import that runs from SCCM nightly and one of the things is populates in Config Mgmt is a PC's primary user, the import takes this and sets the value in an attribute called "Asset owner" which was created by making a relationship with the System.User Object. In other words, it sets a name based on a list of names. My thoughts for how to get this into CMDB were to make a new String Field in Config Mgmt and use a calculation to take the name from the "Asset owner" and simply display it as text. I was hoping I could then use "Data Import" to write the value from Config Mgmt to the new CMDB field.
Here are the properties of the attribute I am trying to pull a name off of:
The issue I am having is that I cannot figure out how to return a value from the "Asset Owner" field. no calculation I have tried so far has worked. An example of what I am attempting is below:
import System
static def GetAttributeValue(ConfigItem):
Value = ConfigItem.AssetOwner.Title
if Value != null:
return Value
else:
return 'No Owner Listed'
This doesn't fail, but it pulls back 'No Owner Listed' , even though I see the record has a name displayed in that attribute. I am worried I am not referencing my value correctly. because this item is related attribute to a list, I am not sure how to map the value. I have tried so many variations of the Value statement trying to find where to pull the name I need. Has anyone ever tried to use a calc to pull a name off of a list before and display it as text?