How to populate previous assignment group in notification

Dasari Srihari
Tera Contributor

Hi Team,

 

How to populate previous assignment group in notification. Whenever ticket is assigning incident to service desk group from any other group we need to send notification. and need populate previous assignment group in notification. and we need send notification to service desk group

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Dasari Srihari 

you can use eventQueue() based approach

I shared solution for this sometime earlier; enhance the same

Show previous assignmnet group, state values from fields into notification 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

@Dasari Srihari 

send the display value

var obj = {};
obj["old_group"] = previous.assignment_group.getDisplayValue();
obj["new_group"] = current.assignment_group.getDisplayValue();
obj["old_state"] = previous.state.getDisplayValue().toString();
obj["new_state"] = current.state.getDisplayValue().toString();
Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

@Dasari Srihari 

share your scripts

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

Hi @Ankur Bawiskar 


 

 

var obj = {};
obj["old_group"] = previous.assignment_group.setDisplayValue();
obj["new_group"] = current.assignment_group.setDisplayValue();
	
gs.eventQueue('event_name', current, 'recipient', JSON.stringify(obj));

var jsonObj = JSON.parse(event.parm2);
	template.print("Previous Assignment Group: " + jsonObj.old_group);
	template.print("<br>");
	template.print("Current Assignment Group: " + jsonObj.new_group);

 

 

@Dasari Srihari 

you didn't copy it correctly.

I mentioned getDisplayValue() but you are using setDisplayValue()

AnkurBawiskar_0-1689167130423.png

 

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