Check on Incident creation for CI - which method is the most effective and fastest?

Don Dom
Tera Contributor

Hello

I got requirement:

 

  • Incident is created with specific CI in the "cmdb_ci_hardware" table.
  • I need to check If an incident already exist, in state different from Closed or Resolved, for the same CI
  • I need to provide a warning popup and do not block the incident creation that IM exists for that CI already.

DonDom_0-1695385220208.png

 

What is the best way to develop it?

What should I consider for it? 

 

Cheers

3 REPLIES 3

Mayur2109
Kilo Sage
Kilo Sage

Hi @Don Dom ,

 

Is any pop up coming now if IM exist for same CI ?

 

Regards,

Mayur Shardul

Nope.

User must choose CI, after choosing when it is filled the popup should appear with warning that there is already other IM opened for this CI.

Hi @Don Dom ,

 

You can create a onchange client script on Incident table, put field on change of affected ci and create one client callable script include. Pass the CI value to script include and query cmdb_ci_hardware table and check whether incident is already there for selected affected ci and if condition matches you can pass answer as true or false based on validation. Get this output in client script and clear the CI field using g_form.clearValue(affected ci field backend name) and g_form.addFieldMessage to populate message on the affected ci field.

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,
Mayur Shardul