How can I abort the creation of an incident once in the script of the Inbound Action?

jalwine
Giga Guru

I have tried current.setAbortAction(true), but the incident still gets created.

gs.log('IA-BACKUP-Group=' + current.assignment_group.getDisplayValue());

if (current.assignment_group == null) {
  // abort
  current.setAbortAction(true);
}


1 ACCEPTED SOLUTION

Thanks for the reply.   I don't do an insert.   I did find my problem.   The test: if (current.assignment_group == null) is not correct.   I don't set the assignment group.   So either its NOT null OR I didn't have the correct syntax.   To correct the issue, I first took out the test and just aborted and it worked.   Next I added a variable and initialized it to false.   If the group is found, then set it to true.   Then I test that.



if (!groupfound) {


  // abort


  current.setAbortAction(true);


}



This does abort the creation of the incident.



In the Email Log, the following Information message was found:


Skipping 'CBC-Create Incident-Backup Failure', did not create or update incident


View solution in original post

2 REPLIES 2

SanjivMeher
Kilo Patron
Kilo Patron

Hi Jay,



in the inbound action, don't do insert() when assignment_group== nill. Thats it.



find_real_file.png



Please mark this response as correct or helpful if it assisted you with your question.

Thanks for the reply.   I don't do an insert.   I did find my problem.   The test: if (current.assignment_group == null) is not correct.   I don't set the assignment group.   So either its NOT null OR I didn't have the correct syntax.   To correct the issue, I first took out the test and just aborted and it worked.   Next I added a variable and initialized it to false.   If the group is found, then set it to true.   Then I test that.



if (!groupfound) {


  // abort


  current.setAbortAction(true);


}



This does abort the creation of the incident.



In the Email Log, the following Information message was found:


Skipping 'CBC-Create Incident-Backup Failure', did not create or update incident