How to create a problem record from a Unsucessfull change?

Arjun Kumar Le1
Tera Contributor

Hi ,

I need to create a problem record from a unsucessfull change, and that problem record need to link in the change related record, how to do this?

 

4 REPLIES 4

H S B
Giga Guru

Do you need help with the code or the approach ?

The below code i have written in after update business rule in change table , it is creating record, How the record will show in related list of change as below screen shot, what to do for it?

 

ArjunKumarLe1_0-1701281993342.png

 



var prob = new GlideRecord("problem");
 prob.initialize();
prob.description = current.description

 prob.cmdb_ci = current.cmdb_ci; // You may need to adjust this field based on your configuration
prob.insert();

 

 

Hi @Arjun Kumar Le1 

It is required M2M relationship.

 

https://www.servicenow.com/community/developer-forum/many-to-many-relation-change-problem/m-p/151881...

*************************************************************************************************************
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/atul_grover_lng [ Connect for 1-1 Session]

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

Can you please share the WHEN TO RUN section of your business rule? I just need to understand in which condition on Change, you are trying to create problem so that I can replicate the same & try it on my PDI & help you with script.

Meanwhile I would suggest you to go through below article as I am pretty sure if you implement correctly it would work - 

https://www.servicenow.com/community/developer-forum/relationship-between-change-request-and-problem...

You need to start with the part where it says 'So, in order for you to see any information in the "Problems" related list'.