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.

Transform map script to stop updating old records in RITM table.

Ssaini1
Tera Contributor

HI Team,

I want to know the script to stop updating/reopening closed RITMs(closed one year ago) due to customers feedback from happy signals integration.
i tried to put the logic like:
setting condition in the onbefore Transform script to stop RITM getting updated but it is not working for me.


1 REPLY 1

Mohan raj
Mega Sage

Hi @Ssaini1,

 

Try below script, I hope it may help you

 

var req = new GlideRecord('sc_req_item');
//request item which was closed last year
req.addEncodedQuery('closed_atONLast year@javascript:gs.beginningOfLastYear()@javascript:gs.endOfLastYear()'); 
req.query();
if(req.next()){
	ignore = true; // ignore the transform map
}else{ 
	source.u_test_1 = target.u_test_1;
	source.u_test_2 = target.u_test_2;
}

 

If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.