For cmdb_ci_win_server table,we need to map location field based on u_server_room,can any one please suggest sample code for setting the location field value based on u_server_room value.

Naga13
Tera Contributor

Dear Group members,

we have requirement as below,

For cmdb_ci_win_server table,we need to map location field based on u_server_room,can any one please suggest sample code for setting the location field value based on u_server_room value.

Best Regards,

Naga.

1 ACCEPTED SOLUTION

If you want to achieve this whenever the server record is created/updated,

then by this logic location will be same as server room when updated/inserted:-

You need to create a BR on windows table

When to run

find_real_file.png

actions

find_real_file.png

 

Result

find_real_file.png

 

Please mark as correct if its helpful to you

Regards,
Anshu

View solution in original post

8 REPLIES 8

Naga13
Tera Contributor

Hi Anshu,

Already some data available with wrong mapping like location field updated based on manager location, so in this case i want to update that data as well,which method is suitable (Background scripts or fix script)

 

Regards,

Naga

background script.

It has a rollback feature if something goes wrong.

Regards,
Anshu

if we write fix script, we can captured and move to other instance but in background script is it possible and fix script also has that rollback feature.

If you have bulk update you can go for fix script

yes it has rollback option i just found

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0761248

Regards,
Anshu