Discovery is not overwriting some values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello,
Working with discovery pattern for a custom table we are trying to update or create new hardware models in the system, from the patter we get the model name and in a pre script we search in the model table to see if it exist and if it does not exist create it, the problem is that if the field is already populated the model field in the CI won't change.
In the example below the first CI did have the model_id field populated before the discovery, that model is not the correct and must be overwrite by the pattern, in the second CI the model was empty and the pattern worked as expected:
the code below get's the company sys id in the line 7, then in the line 16 start checking for the model, if it finds it, it just set the model sys id in the model_id variable in the json, if not it create it in the line 25
I need to know what is missing in the process to overwrite the model in the CIs that already have one
Thanks and regards