Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

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?

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Rudranarayan P2 

you can rename the choice label instead of touching the choice value

This helps in keeping any backend logic as it is and will have minimal impact to the scripts which are using that

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

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.