How to trigger notifications to Agent Workspace?

Anish Reghu
Kilo Sage
Kilo Sage

Hello all,

 

I could do my bit, but I am not able to find where I could post the Body of the notification.

 

Provider > Notification

 

I had referenced the event I created here and defined the Content on the related list, but not sure where to add the body. Do I need to create a Notification Flow Action?

 

Regards,

Anish

1 ACCEPTED SOLUTION

Anish Reghu
Kilo Sage
Kilo Sage
Provider > Notification > Create New > (Related list) > Content tab > New Provider Content (UI Action) > Next Experience (interceptor) > FEED THE BODY OF THE MESSAGE IN THE 'Message' box.

Trigger the event from Script Step in Flow (it works)!


Done!
 
The reason for this thread was - due to a silly mistake made, the gs.eventQueue() was not triggering the notification to the agent who is the assigned to on the case.
 
Instead of using the Workspace route, I chose Next Experience as advised by @Ankur in the previous thread. But still it was not working, when I happened to check that the scope of the step where I parse the JSON is written in Customer Service scope, but rest of the flow and the flow itself is in Global scope. That was causing the issue.
 
Regards,
Anish

The problem was that one of the flow inputs was defined in a scope while the flow was in global scope.
 
 

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Anish Reghu 

you need to give the body in Message field

check these links

Create custom notifications in Next Experience 

Create provider notification in ServiceNow when mentioned on Ticket 

something like this, I just checked OOTB one

AnkurBawiskar_0-1750832454457.png

AnkurBawiskar_1-1750832555722.png

 

 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks @Ankur Bawiskar, good to see you after long time.

I followed the Next Experience option, but it still does not trigger the notification.

 

Sentiment Triggered Notification (Flow Action)

 

Input

 

AnishReghu_0-1750836103681.png

Input variables:

AnishReghu_1-1750836224024.png

 

Script (Step)

(function execute(inputs, outputs) {
    var sentiment = inputs.sentiment;
    var reasoning = inputs.reasoning;

    var gr = new GlideRecord('sn_customerservice_case');
    if (!gr.get(inputs.caseSysID)) {
        gs.warn("Case record not found");
        return;
    }

    gs.eventQueue(
        'case.sentiment.detected',  // Custom event name
        gr,
        sentiment,
        reasoning
    );
})(inputs, outputs);

 

NOTE - The event is not getting fired as well, checked the Event logs.

 

Provider > Notification (Application scope - Global)

 

AnishReghu_2-1750836339758.png

 

Next Experience Content

 

AnishReghu_3-1750836390691.png

 

if you can check and let me know where I did make mistake.

 

Regards,

Anish

 

@Anish Reghu 

Good to see you as well.

not sure if you can trigger that via script

Haven't done that so not much idea.

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I chose Script in Flow Action, since I was configuring the rest of the flow in Flow designer.

What other alternates should we try. I know of Business rule, but not sure how to pass flow output to business rule.

 

Regards,

Anish