Process Designer question for Incidents

I can't seem to wrap my brain around this for some reason.

OOB in the Incident workflow is a ruleset called that is on the transition to the Closure phase.

Within that RuleSet is a rule called "Run JavaScript Pre-Validation to check incident task". and it checks via javascript to see if there are any opened Incident tasks. If there are, a message displays and the incident will not close.

We want to instead check for opened tasks when users put the Incident in a Resolved status.  So I copied the javascript and created a new RuleSet and put it on the transition before the Review phase.

It correctly checks and gives appropriate msg if there are any opened tasks.  I also have the script setting the status back to "Work in Progress" and the Phase to "Investigation".  But how can I force it to skip the Review phase and co back to the Investigation phase.  At this point it is actually executing the Review phase and then going back to the Investigation phase.  It does correctly reset the status to Work in Progress but the phase is Recovery and not Investigation

Basically, I want to check and if there are opened tasks, I don't want the Review phase to execute.

Here is the javascript and I attached a screenshot that shows the incident acutally resolves then goes back to the previous phase

if(lib.c.$("#incidentService").countActiveTasksOfIncident(record.number)>0) {
    returnCode = 1;
    record.problem_status="Work In Progress";
    message=system.functions.scmsg (112, "im", [record.number]);

Top Replies

  • HI @fcbcd

    I'am suggesting do the next: 

    Instead put your JS validation for Review phase

    Put your code JS validation for Investigation phase and set type of rule "on exit"

    In this case you can…