When creating an incident

Community Alums
Not applicable

When creating an incident, the number is auto-populating as INC0010001. However, if I create another new incident without saving the first one, it generates the next number as INC0010002. It should retain the same number as the first one if it's not saved. How can this be achieved?

2 ACCEPTED SOLUTIONS

Chaitanya ILCR
Kilo Patron

Hi @Community Alums ,

set the property to true

glide.itil.assign.number.on.insert

ChaitanyaILCR_1-1749751460737.png

 

ChaitanyaILCR_0-1749751448554.png

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

Hi @Community Alums ,

That property helps to prevent the generation of unused task numbers. by assign the number after the task is inserted into the database

 

OOB

there is a BR : Get Number

 

if you enable set the property to true

the 5 line in this BR runs and returns null

else 

10th line runs and increases the counter by 1

function getNextObjNumber() {
  var assignOnInsert = gs.getProperty("glide.itil.assign.number.on.insert");
  if (assignOnInsert == 'true') {
     if (current.sys_id.isNil()) {
        return null;
     }
  }

  var nm = new NumberManager(current.sys_meta.name);
  answer = nm.getNextObjNumber();

  if (assignOnInsert == 'true'&& current.sys_meta.name != 'sys_report_summary')
    gs.addInfoMessage(gs.getMessage('Number') + ' ' + answer + ' ' + gs.getMessage('was assigned to') + ' ' + current.sys_meta.label);

  return answer;
}

ChaitanyaILCR_0-1749787605312.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

3 REPLIES 3

Chaitanya ILCR
Kilo Patron

Hi @Community Alums ,

set the property to true

glide.itil.assign.number.on.insert

ChaitanyaILCR_1-1749751460737.png

 

ChaitanyaILCR_0-1749751448554.png

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Community Alums
Not applicable

Hi @Chaitanya ILCR ,
how it is interlinked with that incident number

 

Hi @Community Alums ,

That property helps to prevent the generation of unused task numbers. by assign the number after the task is inserted into the database

 

OOB

there is a BR : Get Number

 

if you enable set the property to true

the 5 line in this BR runs and returns null

else 

10th line runs and increases the counter by 1

function getNextObjNumber() {
  var assignOnInsert = gs.getProperty("glide.itil.assign.number.on.insert");
  if (assignOnInsert == 'true') {
     if (current.sys_id.isNil()) {
        return null;
     }
  }

  var nm = new NumberManager(current.sys_meta.name);
  answer = nm.getNextObjNumber();

  if (assignOnInsert == 'true'&& current.sys_meta.name != 'sys_report_summary')
    gs.addInfoMessage(gs.getMessage('Number') + ' ' + answer + ' ' + gs.getMessage('was assigned to') + ' ' + current.sys_meta.label);

  return answer;
}

ChaitanyaILCR_0-1749787605312.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya