Active the on Hold Incident If caller responses back on service portal in comment section

akashyada1
Tera Contributor

Hello 

 

I am working on one task to update the Incident to state Active if it is on Hold when caller responses back on service portal in comment section for same incident

for above requirement 

I have created the before update business rule as below

 

When to Run Condition

akashyada1_0-1723140091771.png

 

Script to run

(function executeRule(current, previous /*null when async*/) {
if (!gs.action.getGlideURI().toString().indexOf('sp') > -1) {
setAbortAction(true);
}
else{
    current.incident_state = 2;
    current.state= 2;
}
})(current, previous);

akashyada1_1-1723140147705.png

 

I have added the abort action condition to avoid the BR run when same incident is getting updated from Incident form it should run when Incident will get updated from portal 

but above BR is not working kindly Assist on this

 

attaching the Portal view (FYI) comment section of Incident from where end user supposed to post the comments when it is on Hold & it should change the state to Active 

 

akashyada1_2-1723140577756.png

 

 

@Ankur Bawiskar 

@Pradeep Sharma 

@avani2 

 

Could you please assist on this 

 

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@akashyada1 

small update; also are you sure the BR condition is getting satisfied and it's going inside the else condition?

(function executeRule(current, previous /*null when async*/) {
if (!gs.action.getGlideURI().toString().indexOf('sp') > -1) {
current.setAbortAction(true);
}
else{
current.incident_state = 2;
current.state= 2;
}
})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader