Duplicate incidents with the same numbers are generating

neetakamble
Kilo Contributor

HI All,

Duplicate incidents with the same numbers are generating with the different sys id.

Seems thsi issue when users are sending mails with the attachment and attaching the images.

How to avoid this. Please suggest?

6 REPLIES 6

It is there on the list view. You can bring that field into the form by configuring the Form Design.

Vaishnavi Lathk
Mega Sage
Mega Sage

Hi ,

This issue is caused when users double click the "Submit" button.   From what I understand this is a known issue and the way to prevent it is to make the ticket number "unique".   In the task table dictionary record for "number", you can personalize the form and add the "unique" field.   Check this box and save the record to enforce primary key constraints for the ticket number.

Note that before you can do this, you will first need to identify and remove all duplicate numbers on the task table.   To identify the duplicates, create a client callable script include named dupTasks with the following code:

 

function dupTasks() {

 

  var dupRecords = [];

 

  var gaDupCheck1 = new GlideAggregate('task');

 

  gaDupCheck1.addAggregate('COUNT', 'number');

 

  gaDupCheck1.groupBy('number');

 

  gaDupCheck1.addHaving('COUNT', '>', 1);

 

  gaDupCheck1.query();

 

  while (gaDupCheck1.next()) {

 

  dupRecords.push(gaDupCheck1.number.toString());

 

  }

 

  return dupRecords;

 

}

 

Now, navigate to task.list and enter the filter:   "Number" "Is" "javascript:dupTasks()" and click Run.   I will let you decide on how you should handle removing the duplicates.