How to Move the problem state from 'Fix in Progress' to Resolved based on condition?

Ashok32
Tera Contributor

Hi ,

I have a requirement 

when Problem Record moves from state "Fix in progress" to "Resolved" it needs to check the condition ie..,When the Problem task is Open then the Problem record will not move from "fix in progress" to "Resolved" and display error message .If problem Task is closed then the problem record will moves to Resolved state.

 

 

 

 

Thanks in advance 

2 REPLIES 2

Harish KM
Kilo Patron
Kilo Patron

Hi you can have a before update Business rule on Problem Table

Condition: when state changesto resolved

Script:

var pTask= new GlideRecord("problem_task");
pTask.addQuery("problem",current.getValue("sys_id"));
pTask.addQuery('state','NOT IN','2'); //  Problem Task state not in closed
pTask.query();
while(pTask.hasNext()){
gs.addErrorMessage("If problem Task is closed then the problem record will moves to Resolved state "+current.number);
current.setAbortAction(true);
}

Regards
Harish

Hi harish 

I tried the above code.But it checks all the problem records states,and it takes toooooo long to display that error message.