Discovery creating the CI bypassing the mandatory fields.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2019 07:48 AM
Hi,
We have make some fields mandatory for the Server Table at the dictionary level. Now the thing is after running the discovery it is creating the CI although the mandatory fields are blank.
I already checked the system property glide.required.attribute.enabled and it is enabled.
I have checked the identification of this and it is like
Table : server
Attributes : IP,Name & Serial Number.
COuld someone let me know about this why this is happening & how should i stop the creation of CI without populating the mandatory
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2019 09:14 AM
Can you try one quick test? Try to push a record into the table using an API call. See if it works when those are blank. The checkbox at the database dictionary level doesn't actually work the way most people think it does. At the database level there is no "mandatory" field assignment it's actually all done with a global business rule that does the check and I am wondering if this behaviour is just tied to the MID server doing it or something else. Are you seeing similar behaviour on other tables with mandatory fields? I would also be very careful about marking any field mandatory that way as it's going to give you problems at some point (I would put a ui policy/client script/data rule in versus using the mandatory field as you should still want discovery to populate the CMDB even if it's missing that data because that's what your audit process is for). If you don't know that there is a problem then you will be missing data with no easy way to follow-up on it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2019 09:35 AM
Thanks Robert for the reply.
After posting this here, i tried this with the Data policy when i make serial number mandatory and after running the discovery in the status it shows that the CI is created although in the table it is not creating the CI.
Also i have tested this by importing the data into the table it is creating the record whilst the dictionary field is mandatory but when i make the data policy active it again hasn't created the records.
WITH the API i will check it again and update this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 06:11 AM
Hi Robert,
I checked this through the API call by pushing a dummy CI in to the linux table. I am getting the below.
Loaded the Data Lookup cache in 4 ms
identification_engine : REQUIRED_ATTRIBUTE_EMPTY Missing mandatory field [operational_status] in table [cmdb_ci_linux_server]. Add input value for mandatory field in payload: no thrown error
identification_engine : ABANDONED Too many other errors: no thrown error
identification_engine : createOrUpdateCI: Matched 1 records and 0 relations in 3msec
identification_engine : Detected error while processing payload from ServiceNow: no thrown error
identification_engine : Input = {"items":[{"className":"cmdb_ci_linux_server","values":{"discovery_source":"ServiceNow","mac_address":"4653XYZ","name":"stry0900844 CI 2","serial_number":"9876EFGH","ip_address":"10.10.10.4","ram":"1238"},"lookup":[],"related":[]}],"relations":[]}: no thrown error
identification_engine : Output = {"items":[{"sysId":"Unknown","identifierEntrySysId":"Unknown","errors":[{"error":"REQUIRED_ATTRIBUTE_EMPTY","message":"Missing mandatory field [operational_status] in table [cmdb_ci_linux_server]. Add input value for mandatory field in payload"},{"error":"ABANDONED","message":"Too many other errors"}],"identificationAttempts":[{"identifierName":"Server rule","attemptResult":"NO_MATCH","attributes":["ip_address","name","serial_number"],"searchOnTable":"cmdb_ci_server"}]}],"relations":[]}: no thrown error
identification_engine : Identification Engine Total execution time 10msec
*** Script: {"items":[{"sysId":"Unknown","identifierEntrySysId":"Unknown","errors":[{"error":"REQUIRED_ATTRIBUTE_EMPTY","message":"Missing mandatory field [operational_status] in table [cmdb_ci_linux_server]. Add input value for mandatory field in payload"},{"error":"ABANDONED","message":"Too many other errors"}],"identificationAttempts":[{"identifierName":"Server rule","attemptResult":"NO_MATCH","attributes":["ip_address","name","serial_number"],"searchOnTable":"cmdb_ci_server"}]}],"relations":[],"logContextId":"ce986edadb9033487dfbe5b74b96196e"}
Looks like through the API call it is not allowing the data to be inserted into the CMDB.
DO you have any suggestion for this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2019 10:28 AM
I have experienced the CI not creating if there is a mandatory field like "Supported by" on the CI form. When discovery is identifying it is not able to update/save because there is no information in the mandatory field on the form.
It is recommended to remove the * from the CI form. Empty fields would be managed by using CMDB Health Preferences and inclusion rules.