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.

Run Update Set Commit from server script

patrickfitz
Kilo Contributor

Hi,

I would like to write a server side script that commits a specified (previewed) updated set. I looked at the UI Action for 'Commit' and found the following ootb code:

			var ajaxHelper = new com.glide.update.UpdateSetCommitAjaxProcessor();
			ajaxHelper.addParam('sysparm_type', 'validateCommitRemoteUpdateSet');
			ajaxHelper.addParam('sysparm_remote_updateset_sys_id', grUS.sys_id);
			ajaxHelper.getXMLAnswer(_handleResponse);	

Since this is an Ajax helper, I cannot run this from a server side script.

Any suggestions on how I can execute the 'Commit' code server side?

Thanks

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why to do this using a script and not UI?

What would you do with the errors/warnings?

Regards
Ankur

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

Just exploring it right now; but if there are error/warning, they would need to be manually addressed.

Hi,

I could not find the script include "UpdateSetCommitAjaxProcessor"

Seems it comes from platform level.

Unless we know how the function is written; it would be difficult to invoke it from server side.

regards
Ankur

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