Pattern designer: union to $cmdb_serial_number has a prerequisite?

danielherre
Tera Guru

Hello!

Creating a pattern to add a device into [cmdb_ci_network_controller], I try to insert the serial number I get from the device into the serial number table [cmdb_serial_number], to have a related list like servers or lan switches have.
For this I used Union Table Step:

  • First table $cmdb_serial_number
  • Second table $cmdb_serial_number_temp
  • Target table $cmdb_serial_number

I debugged it and $cmdb_serial_number_temp is correctly populated, but after the union step $cmdb_serial_number has no data.

 

However if I try the same step on a different pattern but on a different target class [cmdb_ci_netgear], and it works. I am repeating the same steps among the two patterns so I am very confused for this behavior, also I can't find any log messages that gives me a clue.

 

Anyone can provide a hint on what would be the cause for this? Maybe it is related to the CI classes hierarchy?
[cmdb_serial_number] need to have any suggested relation to [cmdb_ci_network_controller] or any similar limitation to write to CMDB tables from within a pattern?

Thank you!

3 REPLIES 3

vaishali231
Kilo Sage

hey @danielherre 

This does not look like a limitation of cmdb_ci_network_controller itself. The serial number related list is normally shown when records exist in cmdb_serial_number and are correctly linked to the CI.

Please check the below points:

Validate the CI reference

Make sure the record in $cmdb_serial_number_temp has the CI reference populated.

Required fields should be similar to:

cmdb_ci = <sys_id of the discovered CI>

serial_number = <serial number from device>

serial_number_type = <type>

If cmdb_ci is empty or not resolved at that step, the union may not insert anything useful into cmdb_serial_number.

Check the pattern step order

The CI should be identified or created before inserting data into cmdb_serial_number.

Recommended flow:

Discover device

Identify/Create CI

Get CI sys_id

Populate serial number temp table

Union/insert into cmdb_serial_number

Compare the working pattern

Since the same logic works for cmdb_ci_netgear, compare both patterns for:

Identification section

Target CI class

CI sys_id variable

Serial number mapping

Step order

Reconciliation rules

The issue is likely that the cmdb_ci_network_controller CI sys_id is not available at the time the serial number table is being populated.

Check if the temp table has data before and after union

Add debug/log steps before the union to confirm:

Temp table row count

Serial number value

cmdb_ci value

serial_number_type value

Relationship is not the main requirement

You do not need a separate suggested relationship between cmdb_serial_number and cmdb_ci_network_controller. The important link is the reference field on cmdb_serial_number pointing to the CI.

So the likely cause is not class hierarchy, but missing or unresolved CI reference, pattern execution order, or reconciliation/identification behavior for that specific target class.

 

************************************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.

Doing so helps others in the community and encourages me to keep contributing.

Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb




 

hey @danielherre 

Hope you are doing well.

Did my previous reply answer your question?

If it was helpful, please mark it as correct ✓ and close the thread . This will help other readers find the solution more easily.

 

Thankyou & Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb








SK Chand Basha
Tera Sage

Hi @danielherre 

Can you use Transform Table Operation in Pattern Designer.