- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 12:37 AM
Hi!
I have configured a Reconciliation Rule for Computer class from the CI Class Manager. It includes the fields that can be modified by ImportSet data source. It is the only reconciliation rule for the class, and it does not have any conditions:
To test the new reconciliation rule, I have run the following code, using the IRE Engine:
var inputPayload = {
"items": [
{
"className": "cmdb_ci_computer",
"lookup": [],
"values": {
"model_number": "ABC-Test",
"name": "New Name Value",
"asset_tag": "123456",
"ram": "1024",
"cpu_count": "4",
"serial_number": "MJ58PWTR"
}
}
],
"relations": []
};
var encodedInputPayload = new JSON().encode(inputPayload);
var dataSource = 'ImportSet';
var outputPayload = SNC.IdentificationEngineScriptableApi.createOrUpdateCI(dataSource, encodedInputPayload);
gs.print(outputPayload);
And this is the output payload after running it:
{
"items": [
{
"className": "cmdb_ci_computer",
"operation": "UPDATE",
"sysId": "bc16452adbffd810c7529ec25a96c956",
"maskedAttributes": [],
"identifierEntrySysId": "025742f4dbdad850b7529bc2ca9619e7",
"identificationAttempts": [
{
"identifierName": "Computer rule",
"attemptResult": "MATCHED",
"attributes": [
"serial_number"
],
"searchOnTable": "cmdb_ci_computer",
"hybridEntryCiAttributes": []
}
]
}
],
"relations": []
}
The computer was correctly identified (using the serial_number) and updated. However, and this is the issue, the IRE updated all fields included in the input payload, even those fields that shouldn't be authorized to be updated by the data source "Import Set". For instance, the reconciliation rule created allows to modify the ram, but it does not allow to update the name. I expect the IRE engine to abort the update of non-authorized fields, following the definition of our reconciliation rule, and adding them to the output payload property "maskedAttributes", as it is described in the official documentation: https://docs.servicenow.com/bundle/paris-application-development/page/app-store/dev_portal/API_reference/IdentificationEngineScriptableApi/concept/c_IdentEngineScriptAPI.html
Has anyone else had this issue?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 02:42 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 12:50 AM
Also have a look on Precedence Rule.
Regards
RP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 02:07 AM
Hi
I used this Payload to test from background script.
var inputPayload = {
"items": [
{
"className": "cmdb_ci_computer",
"lookup": [],
"values": {
"name": "RP_COMPUTER",
"ram": "1024",
"cpu_count": "4"
}
}
],
"relations": []
};
var encodedInputPayload = new JSON().encode(inputPayload);
var dataSource = 'ImportSet';
var outputPayload = SNC.IdentificationEngineScriptableApi.createOrUpdateCI(dataSource, encodedInputPayload);
gs.print(outputPayload);
It skipped RAM Update as i defined in RECONRULE Ram Update comes from Source=Manual Entry with high precedence over other source.
========================================================
identification_engine : Reconciliation: update to field 'ram' of CI '2180e8012f80e810db6859ab2799b6b0' was skipped because of rules [adb1ec012f80e810db6859ab2799b6ab] defined in cmdb_reconciliation_definition
*** Script: {"items":[{"className":"cmdb_ci_computer","operation":"UPDATE","sysId":"2180e8012f80e810db6859ab2799b6b0","maskedAttributes":
=========================================================
Hope this is what you was looking for
Regards
RP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 02:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 03:42 AM
Thanks a lot! After adding a new reconciliation rule with higher ranking it has started to work.