Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

After Business Rule

Mark Wood
Tera Contributor

Hello Experts,

I want to set the field value for the work note field on the incident form when the incident state is updated to resolve. I am trying to use after business rule. but it's not working when I try with the before business rule it's working. please tell me why I am not able to set a value on record to get an update. thank you.

 

//Before Update Business Rule Code
(function executeRule(current, previous /*null when async*/) {
	var arr_ci=[];
	var gr=new GlideRecord('task_ci');
	gr.addQuery('task',current.sys_id);
	gr.query();
	while(gr.next())
	{
arr_ci.push(gr.getDisplayValue('ci_item'));

	}

	current.work_notes = 'Task is currently assigned to InfoSec team'+arr_ci;

})(current, previous);
5 REPLIES 5

🤣

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn