Here is a quick fix to add workflow to ServiceNow Project and Portfolio Management.
There is a huge advantage to do this. Workflow can allow easier visibility into the current process, it is easier to explain, and easier touse than standard Business Rules.
Below are the steps to add workflow to SN PPM:
CODE
1. Add UI Action: Show Workflow
Note: You can also just copy an existing "Show Workflow" UI Action and change the table to pm_project.
Table: pm_project
Form Link: true
On Click: showWorkflowContext()
Condition: !current.isNewRecord() && (new Workflow().hasWorkflow(current))
Script:
// Show the workflow context in a new window
function showWorkflowContext() {
var id = $F('sys_uniqueValue');
var url = new GlideURL('context_workflow.do');
url.addParam('sysparm_stack', 'no');
url.addParam('sysparm_table', g_form.getTableName());
url.addParam('sysparm_document', id);
var w = getTopWindow();
w.popupOpenFocus(url.getURL(), 'show_workflow_context', 950, 700, '', false, false);
}
2. Add UI Action: Workflow Context
Note: You can also just copy an existing "Workflow Context" UI Action and change the table to pm_project.
Table: pm_project
Form Link: true
On Click: showWorkflowContext()
Condition: gs.hasRole('workflow_admin') && !current.isNewRecord() && (new Workflow().hasWorkflow(current))
Script:
var url = 'wf_context.do?sysparm_query=id=' + current.sys_id.toString();
action.setRedirectURL(url);
3. Workflow Properties
In your workflow properties, add the table: pm_project and any conditions you need.
Supporting Files
It's that simple to add workflow to ServiceNow PPM. Try it out with any new SN PPM implementation.
Mike