Email notification to team

Sharath807
Tera Contributor

Hi all, so how to trigger a  Mail notification to respective support team 1 or  support team 2, when incident is pending with "Inactive" members.

1 ACCEPTED SOLUTION

Rohit99
Mega Sage

Hi @Sharath807 ,

 

Create Event as Follows:

mail_script_01.PNG

 

To work on past/existing records you may write fix script as follows:

 

var gr = new GlideRecord('incident');
gr.addEncodedQuery('active=true^assigned_toISNOTEMPTY')
gr.query();
while(gr.next())
{
if(gr.assigned_to.active == false)
{
gs.eventQueue('Inactive User Notification', gr , gr.number, gr.short_description); 
}
}

 

For further inactivation of users you may write business rule as follows:

Type : before->Update

condition: active -> changes to -> false

script:

var gr = new GlideRecord('incident');
 gr.addQuery('assigned_to',current.sys_id);
   gr.query();
    while(gr.next())
    {
        gs.eventQueue('Inactive User Notification', gr , gr.number, gr.short_description);
    }
Now you can write the notification and in when to send field select event is fired.
 

Please mark my response as correct and helpful if it helped solved your question.

 

Thanks,

Rohit Suryawanshi

View solution in original post

13 REPLIES 13

Yashsvi
Kilo Sage

Hi @Sharath807,

please check below link:

 

https://www.linkedin.com/posts/hrishabhkumar_microsoft-teams-spoke-integration-activity-718884341831...

 

Thank you, please make helpful if you accept the solution.

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Sharath807 

 

Before you try this, why an incident is assigned to Inactive user? 

Try this

AGLearnNGrow_0-1718174471725.png

 

and in 

AGLearnNGrow_1-1718174493708.png

 

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sharath807
Tera Contributor

@Dr Atul G- LNG Hi. Actually its in pending with inactive user.. So the user may be inactive after assigning it to him. 

Hi @Sharath807 

 

SO in this create a Flow, which check the status of Active incident and if found any assigned to.Active = False send email. 

 

Trigger

Schedule

 

Action 

Look up records

Action

Send email

 

It is pretty easy and low code. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************