- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-17-2023 08:58 PM
Hi All,
I have a requirement that , basically when HR case is created , they manually create HR tasks, i want to trigger a notification that it checks all the tasks associated with case as closed complete then the notification will trigger to health group? and that includes body as
Hi <HR service name>
Please note that the tasks you have requested on <date of tasks submitted> for <Employee Name> have now been marked as complete.
Please help to resolve this
Thanks
Ramu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-18-2023 04:47 AM
then do this
1) have notification on HR Task, with your subject, body etc. I hope you know how to do this
Condition as State Changes to Close
2) Use advanced condition in notification and check if this task is the last one; if yes then set answer=true
var gr = new GlideRecord("sn_hr_core_task");
gr.addActiveQuery();
gr.addQuery("parent", current.parent);
gr.setLimit(1);
gr.query();
answer = !gr.hasNext();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-18-2023 06:59 AM
something like this. please enhance
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord("sn_hr_core_task");
gr.addQuery("parent", current.parent);
gr.query();
while (gr.next()) {
template.print("Please note that the task you have requested on " + new GlideDateTime(gr.sys_created_on).getDate() + "for " + gr.parent.subject_person.name + " have now been marked as complete.");
}
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-18-2023 06:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-18-2023 06:59 AM
something like this. please enhance
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord("sn_hr_core_task");
gr.addQuery("parent", current.parent);
gr.query();
while (gr.next()) {
template.print("Please note that the task you have requested on " + new GlideDateTime(gr.sys_created_on).getDate() + "for " + gr.parent.subject_person.name + " have now been marked as complete.");
}
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-18-2023 07:22 AM - edited ā10-18-2023 09:15 AM