Avoid duplicate incidents , requests , problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 02:59 AM
Hi all,
kindly help me to avoid the duplicate incidents , requests , problems ...either manually or through integration .
we had options like Unique button and colease make true in transform maps .
Kindly provide other alternate way ( business rule) to avoid duplicate records.
i have tried many , but no luck , kindly help on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 03:08 AM
Hi,
If you are performing integration with any third party and you want that when an incident gets created in third party it should be created in SNOW, then transform maps provides a good solution for it.
In order to avoid duplicacy , you can use coalesce on incident number field, which will prevent duplicate incidents from being created.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 03:17 AM
Hi,
On Incident table create On-Before Business Rule for incident table
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
var gr = new GlideRecord('incident');
gr.addQuery('active', true);
gr.addQuery('sys_id', '!=', current.sys_id);
gr.query();
if(gr.next()) {
gs.addErrorMessage('Incident Already Exist');
current.setAbortAction(true);
}
}
Hope this is Helpful.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 03:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 04:31 AM
Hi Snow,
We also faced the same issue and Servicenow suggested us to create a before insert business rule on task table.
var curNum = current.number + '';
if(curNum) {
var recordClass = current.getRecordClassName();
var gr = new GlideRecord(recordClass);
gr.addQuery('number', curNum);
gr.query();
if(gr.getRowCount() > 0) {
var newNum = getNextObjNumberPadded();
gs.addInfoMessage("The number " + current.number + " was already used by another " +
recordClass + ". The " + recordClass + " number has been changed to " + newNum);
current.number = newNum;
}
}