Background script to replace a value in incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 05:50 AM
There are 2 tables u_organization (old table) and security_organization (new table). Now incident are referring old table and need to change to new table as reference but old incident organization field value will be empty after changing reference table, is there a way we can update value for old incidents. Old table and new table value are almost same example old table has INDIA and new table IND as organization field value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 05:55 AM
Can you have any relationship that can tell us for an old record which one is new record?
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 06:14 AM
there are 2 different tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 06:16 AM
Yes,
If you want to replace the old values (old table)with new values (new table).
You should be knowing the relationship between the two tables so that accordingly script can be written to update the incidents.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 06:15 AM
@Ravi kiran1 As the reference field is nothing but a string field in backend. you can write the background script first and update the records. As still the field is referencing to old table you will see empty in that field. After moving change the reference of that field to new table.
Use below script:
ServiceNow Community Rising Star, Class of 2023