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.

Is it possible to set the value of URL?

tyagisu
Mega Expert

Hello,

I am moving a scoped application from one instance to another. I have a lot of errors in the update set. I want to skip all of them at once. There are around 213,240 errors. I am planning to use fix script for that. This is the script I am using and not working. I am sure that's not the right way to set  the value of URL field "available_actions".

var gr = new GlideRecord("sys_update_preview_problem");
var qry = 'remote_update_set=7ceb91e9db40ef804718b0f0ef96190c^status=^description=Could not find a table ***** this update requires';
gr.addEncodedQuery(qry);
gr.query();
while (gr.next()) {
gr.available_actions = 'Skip remote update';
gr.update();
}

Any help would be appreciated! 🙂

Thanks in Advance!

Su

1 ACCEPTED SOLUTION

Use the while loop

var gr = new GlideRecord("sys_update_preview_problem");
var qry = 'remote_update_set=7ceb91e9db40ef804718b0f0ef96190c^status=^description=Could not find a table ***** this update requires';
gr.addEncodedQuery(qry);
gr.query();

gs.print("Row Count is: " + gr.getRowCount());

while(gr.next()) {
//You can put gs.action as the action parameter.
var ppa = new GlidePreviewProblemAction(gs.action, gr);
ppa.skipUpdate();
}

View solution in original post

12 REPLIES 12

Use while loop instead of if

Use the while loop

var gr = new GlideRecord("sys_update_preview_problem");
var qry = 'remote_update_set=7ceb91e9db40ef804718b0f0ef96190c^status=^description=Could not find a table ***** this update requires';
gr.addEncodedQuery(qry);
gr.query();

gs.print("Row Count is: " + gr.getRowCount());

while(gr.next()) {
//You can put gs.action as the action parameter.
var ppa = new GlidePreviewProblemAction(gs.action, gr);
ppa.skipUpdate();
}

Nice!

It worked. Thank you all.

Thanks a lot! 🙂

Su