How to send a email notification when the scheduled job will be failed

Sagaya1
Giga Expert

Hi ,

I have a scheduled data import which will pull the data from external DB and push it into servicenow table.

Now i need to send a email notification if the job will fail. So please help share the steps / sample code .

1. Do  we need to write a script in "execute post -import script" in scheduled data import? if yes please share the sample code.

2. OR need to write a script in "transform script - on complete" in transform map? if yes please share the sample code.

3. How to send a email notification if job fail? please share the sample code & steps.

 

Regards

Sagaya.

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

You've got a couple options which are covered in the below post, but it rather depends if your notification is just a "hey, this broke" or if you want to include details. Also depends if you want a single email for the overall report or email notification per line.

https://community.servicenow.com/community?id=community_question&sys_id=77fa4baddb5cdbc01dcaf3231f961939

View solution in original post

2 REPLIES 2

SanjivMeher
Kilo Patron
Kilo Patron

So basically you want to send a notification when an import fails?

You can create a notification on the Import Set Run table, with Condition State = Completed with Errors 


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

Kieran Anson
Kilo Patron

You've got a couple options which are covered in the below post, but it rather depends if your notification is just a "hey, this broke" or if you want to include details. Also depends if you want a single email for the overall report or email notification per line.

https://community.servicenow.com/community?id=community_question&sys_id=77fa4baddb5cdbc01dcaf3231f961939