I want to make a ui button 'REOPEN INCIDENT' on the incident form. Whenever we clicked on this updates will happen on the server side like incident state become close to active and on the client side comment field become mandatory.

silentkiller
Kilo Contributor

I want to make a ui button 'REOPEN INCIDENT' on the incident form. Whenever we clicked on this updates will happen on the server side like incident state become close to active and on the client side comment field become mandatory.

7 REPLIES 7

Shweta KHAJAPUR
Tera Guru

HI  Silentkiller,

 

You can create your own custom UI Action. Try below code

Action name:-reopen_incident

onclick:-reopenIncident()

 

In script try below code
 
function reopenIncident(){
g_form.setMandatory('comments', true);

gsftSubmit(null, g_form.getFormElement(), 'reopen_incident');
}

current.incident_state = 2;
current.update();
gs.addInfoMessage(gs.getMessage("Incident reopened"));
action.setRedirectURL(current);
 

Thanks Shweta. Its wrking..

Hi,

 

If you find the solution please mark it as correct.