- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 10:47 PM
Hi All,
Actually, I need to send an email notification to the 'assign to' user managers on incident form if the incident state is in progress at every Monday. For this, I have used run script scheduled job in the script I have mentioned the below code. Please help me on this.
In the array I am getting repeated email ID's of managers need to remove that, one email is enough to one particular manager. But by using the below code manager receiving emails repeatedly from all incidents. Please help me on this.
Scheduled script:
var emailList = [];
var incGr = new GlideRecord('incident');
incGr.addQuery('state','3');
incGr.query();
while(incGr.next()){
var userGr = new GlideRecord ('sys_user');
userGr.addQuery('sys_id', incGr.assign_to);
userGr.query();
if(userGr.next()){
var managerEmail = userGr.manager.email;
emailList.push(managerEmail);
gs.event('user_manager_emails', incGr, emailList);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 07:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 07:41 AM
Thank you soo much, Martin