What is the 'action' object in the UI action?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 02:20 PM
var ppa = new GlidePreviewProblemAction(action, current);
ppa.ignoreProblem();
I saw this out of the box code in the the 'Accept remote update' UI action.
I want to execute this script in the background script.
For that i want to know what this 'action' object referring to or what can i use in its place?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 07:35 PM
Hi Ravio,
The action variable is a special variable in UI Action scripts. It allows you to perform redirects as in this wiki article: Creating a UI Routing Action - ServiceNow Wiki.
It is of the class GlideAction but this class (formerly packages.com.glide.script.Action) is not documented so there is no telling how or if you may be able to use it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 07:42 PM
I face with the same problem,
Community, Please help!!!
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 08:28 AM
Hi Ravio,
You can put gs.action as the action parameter.
An example usable by us who are lazy :
var gr = new GlideRecord("sys_update_preview_problem");
gr.addEncodedQuery("remote_update_set=5a3b8a5c0fcf32005e9a1b2be1050ed5^status=^description=Found a local update that is newer than this one");
gr.addQuery("status","");
gr.query();
while(gr.next()) {
var ppa = new GlidePreviewProblemAction(gs.action, gr);
ppa.skipUpdate();
}
Outputs:
Background message, type:info, message: Problem has been skipped. The update that caused this problem will not be committed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2020 03:17 AM
It worked like a charm for me. Thanks!!!