The CreatorCon Call for Content is officially open! Get started here.

Show Workflow UI action.

Kalik Magotra
Kilo Contributor

How can we bring the Show Workflow UI action on the incident table?

2 REPLIES 2

Service_RNow
Mega Sage

HI,

Create UI Action an Incident table:

Name : - Show Workflow

Table :- incident

Onclick:- showWorkflowContext()

condition:- !current.isNewRecord() && (new global.Workflow().hasWorkflow(current))

Script:- 

function showWorkflowContext() {
   var id = g_form.getUniqueValue().toString();
   var url = new GlideURL('context_workflow.do');
   url.addParam('sysparm_stack', 'no');
   url.addParam('sysparm_table', g_form.getTableName());
   url.addParam('sysparm_document', id);
   g_navigation.open(url.getURL(), 'show_workflow_context');
}

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy.

Thanks

Sagar Pagar
Tera Patron

Hello Kalik,

 

You need to create a UI action 'Show incident workflow'.

Refer the image.

find_real_file.png

 

Here is the script.

onClick function:  showWorkflowContext();

// Show the workflow context in a new window
function showWorkflowContext() {
    var url = new GlideURL('/context_workflow.do');
    url.addParam('sysparm_stack', 'no');
    url.addParam('sysparm_table', 'incident');
    url.addParam('sysparm_document', g_form.getUniqueValue());
    g_navigation.open(url.getURL(), "_blank");
}

 

Hope this will help you.

Regards,

Sagar Pagar

 

The world works with ServiceNow