When a change request is completed, send an email to the assigned to person on all related problems

Pratiksha Lang1
Kilo Sage

When a change request is completed, send an email to the assigned to person on all related problems and incidents informing of the closure.

2 REPLIES 2

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Can you explain your question a bit more? It's just a one liner know. What are you expecting from community members here?

 

Maybe you can provide some info on what you already performed, what's not working, what your actual issue is, etcetera.

 

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Sagar Pagar
Tera Patron

Hi @Pratiksha Lang1,

 

You have to write After update business rule on Change request [change_request] table. Where condition is when Change request state is closed.

 

Add event in event registry and configured notification and will be triggered based on when event fired through BR.

 

Sample scripts - modify it accordingly.

Problem:

 

if (current.state.changesTo(3)) { // change request state value close (3)
notifyRelatedProbelmAssignee(current);
}


function notifyRelatedProbelmAssignee(chg_request) {
var probObj = new GlideRecord("probelm");
probObj.addQuery("rfc", chg_request.getUniqueValue());
probObj.query();
while (probObj.next()) {
if (probObj.active == true) {

gs.eventQueue("add.event.name.here", probObj, probObj.assigned_to.email.toString());

}
}

 

 

Incident:

	
if (current.state.changesTo(3)) { // change request state value close (3) 
	notifyRelatedIncidentsAssignee(current);
}


function notifyRelatedIncidentsAssignee(chg_request) {
	var incObj = new GlideRecord("incident");
	incObj.addQuery("rfc", chg_request.getUniqueValue());
	incObj.query();
	while (incObj.next()) {
		if (incObj.active == true) {

			gs.eventQueue("add.event.name.here", incObj, incObj.assigned_to.email.toString());

		}
	}

 

Thanks,

Sagar Pagar

The world works with ServiceNow