Update Incident (BP) - Creating new Incident

DB1
Tera Contributor

Hi,

The Inbound Action - "Update Incident (BP)" is creating new incident upon reply.

Scenario tried/tested - I tried to reply to one of the closed Incident but noticed that a new Incident got created.

Below is the code and need help on the same:

gs.include('validators');

if (current.getTableName() == "incident") { 

var gr = current;

if (email.subject.toLowerCase().indexOf("please reopen") >= 0)
gr = new Incident().reopen(gr, email) || gr;

gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;

if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
gr.assigned_to = email.body.assign;

if (email.body.priority != undefined && isNumeric(email.body.priority))
gr.priority = email.body.priority;
}

gr.update();
}

find_real_file.png

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

Are you sure this inbound action is the one doing this?

Can you check your email logs (you can type sys_email.list and press enter in left-hand navigation search, for example) and find the specific test email, once you've clicked the record, scroll down to the bottom and it'll tell you how the email was processed and what inbound action did so.

Example log:

find_real_file.png

OOB I don't believe this inbound action would create a new record as it's set to update match if found. If the email is tagged as a reply email and the inbound action didn't find a match, then it doesn't do anything.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

4 REPLIES 4

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

Can you make sure you do not have any condition passed additionally. Also, can you ensure that the email replied on has watermark (Msg that ServiceNow uses to consider it as reply & upate record is present once).

Allen Andreas
Administrator
Administrator

Hi,

Are you sure this inbound action is the one doing this?

Can you check your email logs (you can type sys_email.list and press enter in left-hand navigation search, for example) and find the specific test email, once you've clicked the record, scroll down to the bottom and it'll tell you how the email was processed and what inbound action did so.

Example log:

find_real_file.png

OOB I don't believe this inbound action would create a new record as it's set to update match if found. If the email is tagged as a reply email and the inbound action didn't find a match, then it doesn't do anything.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

 

Yes I tried it and it worked!

Thanks

Is there a way to assign an Incident to myself or change the state of the Incident with button "Assign/Resolve"

something similar to "Take me to the Incident" button?

Need help on the same please !!

find_real_file.png

 

Hi,

If you don't mind, can you create another question so that we can track that conversation there? Feel free to link me to it here, but we'd love to keep the questions separate, if possible.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!