Business Rule not working on Agent Workspace

Akshay Gowda
Tera Contributor

Hi All,

I was working on the Agent Workspace and I have the following issue:

The Business rules for the Incidents to set status based on the next step is not working as expected.

The next step function is defined in the custom table. The values are fetched from BR and Script Include.

Expected Behavior:

As shown in the attachment 'IncidentForm' - When the State is New - Next Step field show choices based defined on the status flow. Attachment - 'StatusFlowDefinition'

Behavior on Agent Workspace:

As shown in the attachment 'AgentWorkspaceView' - Next step field is displaying all the choices.

 

 

 

 

 

5 REPLIES 5

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Is this in a business rule or client script? Could you post the code?

It's a BR, here is the script:

Condition: current.u_next_step.changes() && current.u_next_step != ''

var statusFlow = new global.StatusFlow(current);
var nextState = statusFlow.getNextState();
// this task object represents current

var thisTask = new Task(current);
// if we got an invalid state/step pair, inform the user
if (nextState == undefined) {
gs.addErrorMessage('Unable to determine the new state. This probably means the status flow for ' + current.getTableName() + ' is not properly configured.');
} else if (nextState != thisTask.getStatus()) {
// use thisTask (KSTask object) to set the state, so we know that all state and table-specific states are set
thisTask.setStatus(nextState);
}

// store the next step and reset
current.u_previous_step = current.u_next_step;
current.u_next_step = '';

Akanksha20
Kilo Contributor

I am also facing the same issue that business rule defined on Incident is not working on agent workspace. Please suggest a solution if possible.

annmoleapen
Giga Contributor

Hi Akshay/Akanksha,

Did you get to the bottom of it? I think it is onBefore business rules that doesn't work in Agent workspace. I have the same issue. Please can you post here if you found the solution.

 

Thanks

Ann