blank Incidents are getting created in Instance

Hemanth Naik
Tera Guru

We got a scenario where Incidents are getting created even when mandatory fields are not filled from Integrations as well as instance. Checked all client scripts and UI policies. All are working fine. May I know the reason for this issue. Please let me know how to resolve this.

2 ACCEPTED SOLUTIONS

Amit Verma
Kilo Patron
Kilo Patron

Hi @Hemanth Naik 

 

The field level validations (such as Mandatory, ReadOnly or Visibility) won't be validated if the incident is being created through external integrations or from server side scripts within the instance. 

 

A simple way to solve this is to ensure that right and mandatory set of inputs goes in for creation of the incident. You can have the validations being enforced on your server side scripts or integrations before the incident gets created.

 

On the instance side, you can have a business rule that could do the check before the record is created to check gs.isInteractive() and recognize whether it is coming from a user or REST API. The BR cannot make a field mandatory, but it can check for null/empty values and throw an error (gs.addErrorMessage()) for mandatory unpopulated fields.

 

Alternatively, you can look out to implement some data policies as well to fix this.

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

View solution in original post

shyamkumar VK
Kilo Patron

@Hemanth Naik  , 

create data policy for this and have that field as mandatory;

so when somebody sends POST and no value in that field then it would throw an error

in left navigation type data policies; create new

give your table name and in data policy rule make your field as mandatory

let me know if you need any more help here

 

Regards,

Shyamkumar 

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

View solution in original post

8 REPLIES 8

Vishal Birajdar
Giga Sage

Hello @Hemanth Naik 

 

Is data policy applied for the fields which are mandatory on forms...??

Can you try applying Data policy and then check...!!!

 

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Thankyou for replying,  @Vishal Birajdar most of the incidents are getting created from  external Integrations

Hello Hemanth...

 

Yeah...understood....!!

 

As mentioned by @Amit Verma  form level validations are not validated when actual data manipulation happens by external sources or while creating incident through Business rule/script.

 

So its better to have fields Mandatory on Database .....

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Amit Verma
Kilo Patron
Kilo Patron

Hi @Hemanth Naik 

 

The field level validations (such as Mandatory, ReadOnly or Visibility) won't be validated if the incident is being created through external integrations or from server side scripts within the instance. 

 

A simple way to solve this is to ensure that right and mandatory set of inputs goes in for creation of the incident. You can have the validations being enforced on your server side scripts or integrations before the incident gets created.

 

On the instance side, you can have a business rule that could do the check before the record is created to check gs.isInteractive() and recognize whether it is coming from a user or REST API. The BR cannot make a field mandatory, but it can check for null/empty values and throw an error (gs.addErrorMessage()) for mandatory unpopulated fields.

 

Alternatively, you can look out to implement some data policies as well to fix this.

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.