Update Change model

PauloMF
Tera Contributor

Hi folks!

I need some help with the following case.

At certain stages, I need to change the model (change-model) of a Change record. Currently, the change type is "Normal", but I need to switch it to "Emergency".

I'm using a Business Rule (running before update) with the following script, but it's not working:

current.setValue('type', 'emergency');
current.setValue('change_model', '62d10fa1c303101035ae3f52c1d3aec1');
current.setWorkflow(false);
current.autoSysFields(false);
current.setUseEngines(false);



The record saves without errors, but the type remains "Normal" and the change model doesn't update.


Thanks in advance!

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@PauloMF 

it must be blocked by state model

💡 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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @PauloMF As per the platform, once a change request has been raised, the model type cannot be changed directly. You would need to cancel the existing change and log a new one. This is expected behavior.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

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
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

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

jMarshal
Mega Sage

@PauloMF  -  as others have mentioned, you cannot change the model once it has been started. Instead, maybe develop a custom feature which is a UI Action called "promote to emergency" which will automatically create a new emergency change, autofills relevant info from the normal change, cancels the normal change and references that change number in the worknotes of the new emergency change.

Also, if you need it to change "Model" at a given stage, it sounds like what you actually need is a new model. A custom model which behaves like an emergency at certain stages. I believe you will be able to set/change the type as needed (it is not mapped to the model) - you can have a custom model which behaves as a normal change but lists type as emergency, for instance.