How to configure the Inactivity notification for problem record

Not applicable

How to configure the Inactivity notification for problem record

I have created Inactivity event
and Notification on problem 
under who will receive - Assignment group of problem is working expected
I also want to send the same notification to the associated problem task analysts 

Thanks 

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@Community Alums 

this article explains it well

How Inactivity Monitor works? 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Medi C
Giga Sage

Hi @Community Alums,


Are you using an event based notification? if so:

  • Ensure "Event parm 1 contains recipient" is checked on your notification
  • Use the following script to gather the Problem task analyst:
var recipients = [];

    // Get all associated Problem Tasks
    var pt = new GlideRecord('problem_task');
    pt.addQuery('problem_id', grProblem.sys_id); //Use your Problem Sys ID
    pt.query();

    while (pt.next()) {
        if (pt.assigned_to) {
            recipients.push(pt.assigned_to.toString());
        }
    }

    gs.eventQueue('problem.inactivity', grProblem, recipients)​

 

Not applicable

Hi @Medi C 
Some where I am missing step please guide me
when to send
Event is fired 

Research_0-1744437322428.png

I selected "Event parm 1 contains recipient"

Research_1-1744437384514.png

Email script

Research_2-1744437605559.png

No luck please guide me
Thanks

Not applicable

Hello @Community Alums, 

 

Please try to implement below solution if it works:

 

Since "Who will receive" in the Notification doesn't directly let you reference related task users in a list, you can use a Notification Script to add them.

🔹 Steps:

  1. Open your Notification

    • Go to System Notification > Email > Notifications

    • Open the notification tied to your inactivity event on the Problem table.

  2. Scroll to the "Who will receive" section

    • Leave the Assignment group entry as-is.

    • Click New to add a new recipient type.

      • Type: Script

      • This lets you add recipients via Glide scripting.

  3. Add the script below to gather "Assigned to" users from all related Problem Tasks:

 

javascript
CopyEdit
(function execute(inputs, outputs) { var recipients = []; var taskGr = new GlideRecord('problem_task'); taskGr.addQuery('problem_id', current.sys_id); taskGr.addNotNullQuery('assigned_to'); taskGr.query(); while (taskGr.next()) { var user = taskGr.assigned_to; if (user && !recipients.includes(user.toString())) { recipients.push(user.toString()); } } outputs.recipients = recipients; })(inputs, outputs);
 
  • This script loops through all Problem Tasks linked to the current Problem, collects all unique assigned_to values, and adds them to the notification recipients.

  1. Save the notification


If this is useful, accept my solution and like which helps alot.