Lifecycle stage and lifecycle status fields not getting populated with transform maps

Shanti7
Tera Contributor

Hi, 

we are implementing CMDB and decided to use the CSDM status fields such as Lifecycle stage and Lifecycle stage status fields. We are trying to load sample data using import sets and transform maps, but these fields are being set to blank despite they are defined in the transform maps. 

Here is the transform script and tried with both lifecycle stage names and sys_ids with no luck. 

 

Shanti7_0-1665724952422.png

Didn't create Lifecycle stage mappings as we are loading the CI data for the first time. 

Tried creating the field mappings too with no luck. 

 

Has anyone experienced the this issue before and knows how to fix it?

 

Thank you,

13 REPLIES 13

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Shanti7 

 

Sorry to ask but could you share all the Scripts you have written including Transform Script and Script Include.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hi Anubhav,

Here is the onBefore transform script which will load data using the IRE API so that identification and Reconciliation rules will be evaluated before a record is inserted and updated. 

 

var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.identifyAndReconcile(source, map, log);
ignore = true;

if (cmdbUtil.hasError()) {
var errorMessage = cmdbUtil.getError();
log.error(errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
}

Mattias S_rlin
Tera Contributor

Hi,

 

I have a similar if not the same problem.

I'm trying to set the life cycle status using an import using transform maps.

I'm setting the values with a field map.

All fields gets imported as expected but not the life cycle stage and status.

 

If I look at the XML for the imported data then I can see that the value is set but not the display value.

For example:

<life_cycle_stage display_value="">53584655b7620010ee0d3177ee11a97f</life_cycle_stage>
<life_cycle_stage_status display_value="">cf194e55b7620010ee0d3177ee11a977</life_cycle_stage_status>
 
You can check to see if it is the same for you.
 
I am currently struggling with this problem and so far I don't have a solution.
I've been testing many times to set the values as sys_id or name, and once it looked right but in the next import it was overwritten and the display values vanished. I noticed that the life cycle status table doesn't have any field as a display value set to true. But it didn't help to set one. At least not for me.
 
So any suggestions?
Thanks!

Hi Mattias, 

Yes, I also have the same issue and couldn't find the exact cause. So logged a call with ServiceNow and awaiting their response. Will update the post when I hear from them. Thank you.

Hi Shanti,

 

Did you get a response from ServiceNw support?

 

Mattias