Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

category/subcategory modification in case records

Rudranarayan P2
Tera Contributor

In a case table the category-subcategory fields are interdependent. There are nearly 30k case records. We need to update the category/subcategory values in the active cases.

ex:

old values:

category- hardware

subcategory - laptop

New values:

category: hardware_001

subcategory-Desktop

 

Q: What is the best approach for such type of requirements?

 

1 ACCEPTED SOLUTION

Dr Atul G- LNG
Tera Patron

Hi @Rudranarayan P2 

]

My recommendation is not to make this change to old records that are already closed or nearly closed. It is fine to apply the change to records that are still in progress.

Alternatively, you could simply rename the existing value. However, if you are planning to create a new value, you should deactivate the old value and use the new value only for new Cases.

I would not recommend updating old records, as the existing value may already be referenced by SLAs, notifications, reports, or other functionality. Changing it could have unintended impacts on historical records and related processes.

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************

View solution in original post

8 REPLIES 8

Tejas Adhalrao
Kilo Sage

hi @Rudranarayan P2  ,

Create a mapping from the old Category and old Subcategory to the new Category and new Subcategory.
Check the mapping using a small number of records in a sub-production instance.
Query only the active cases that need to be changed by using a Background Script or a Fix Script.
Start by updating the category and then update the subcategory.
You should use setWorkflow(false) only after you have made sure that you don't need the Business Rules/Flows/audit logic to run; in all other cases, let the normal automation process go ahead.
It's best to carry out the update in batches not all at once with the 30k records in a single transaction.
Check the count both before and after the update and make sure you have a rollback plan.

Hi @Tejas Adhalrao ,

Thanks for your reply.

My question is regarding the mapping. Is there any particular module for mapping? How can we do the mapping?

 

Dr Atul G- LNG
Tera Patron

Hi @Rudranarayan P2 

]

My recommendation is not to make this change to old records that are already closed or nearly closed. It is fine to apply the change to records that are still in progress.

Alternatively, you could simply rename the existing value. However, if you are planning to create a new value, you should deactivate the old value and use the new value only for new Cases.

I would not recommend updating old records, as the existing value may already be referenced by SLAs, notifications, reports, or other functionality. Changing it could have unintended impacts on historical records and related processes.

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************

Rudranarayan P2
Tera Contributor

Thanks Tejas, ankur, tejas, for your support and guidance.