BR/Client Script to update Incident based on Asset State

GMoon
Tera Guru

Hello,

I have a requirement for the following and would appreciate some help in achieving the result:

 

'Where the State of an Asset is anything but Missing, update the corresponding Incident as follows:

State on Incident ticket to be Closed

Close code - solved permanently

Closure sub cat - other

Close notes - closed by automation due to device state change'

 

Thanks!

2 REPLIES 2

Community Alums
Not applicable

Hi @GMoon ,

You can write a before business rule with below code, just add your required field names along with what you want to display:

 

if(current.incident_state==30){
current.setDisplayValue('state','Work In Progress');
}
else if(current.incident_state==70){
current.setDisplayValue('state','Closed Complete');
}
else
current.setDisplayValue('state','Open');
}

 

Hi Sandeep
Thanks for the reply. Would that script also look at the State on the Asset? I can see it writing values to the Incident but not where it looks at the Asset field 🤔