diff --git a/AbortDuplicates.js b/AbortDuplicates.js new file mode 100644 index 0000000000..1706abea0a --- /dev/null +++ b/AbortDuplicates.js @@ -0,0 +1,14 @@ +(function executeRule(current, previous /*null when async*/) { + + // Add your code here + + var gr=new GlideRecord('incident'); + gr.addQuery('caller_id',current.caller_id); + gr.addQuery('short_description','CONTAINS','email'); + gr.query(); + if(gr.next()){ + gs.addErrorMessage("You have already created the incident with the similar short description"); + current.setAbortAction(true); + } + +})(current, previous);