Tech Enthusiast.

Disable Create Project from Demand Workbench

Officially there isn’t a way to customize Demand Workbench; this can be an issue if you need to stop the creation of artifacts from the context menù (like project or enhancement).

Demand workbench screen create project context menù

Anyway there’s a way to block this feature.

When the button “Create Project” is pressed, Demand Workbench invokes the processor “workbenchAjaxProcessor”.

In the script of the processor, the variable g_request contains referer, so we can check if the processor is invoked from Demand Workbench

var refererURL = g_request.getHeader('referer');

And check on the referURL to find Demand Workbench

var inDemandWorkbench = refererURL.includes('$demand_workbench.do');

And use it to stop the creation

It’s possible to show an error message through the variable “response”.

if (method == 'createProject' && inDemandWorkbench) {
        response = {error: 'Cannot create project from demand workbench'};
        response = (new JSON()).encode(response);
}