Sending notification from UI action.

Community Alums
Not applicable

Hi, 

How can I achieve below requirement? 

1. Create a UI Action on the Problem form with a button at the top labeled "Message to Affected Users".
2. When clicked, a modal window opens for the sender to enter the body of the message. When finished typing, then sender clicks Done.
3. The script behind the button parses all the incidents related to the problem and builds a list of users in the Caller field and watch list for each incident. This becomes the recipients list.
4. The script then sends a notification with a subject similar to "New message regarding <Problem #> - <Short Description> and body text as entered by the sender.

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ganesh,

use this approach:

1) create an event on problem table

2) create email notification on problem table and associate the event with this email

3) when UI action is clicked call UI page with the text field for entering the message body

4) when submit button on UI page is clicked the processing script would trigger the email notification using gs.eventQueue(); the processing script would then determine the incidents related to current problem and store the caller and watch list in array and pass it in eventQueue() parameter

5) use email notification script and set the subject using email.setSubject()

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Community Alums
Not applicable

Hello Ankur,

 

Thank you for the response. I will try the steps which you have shared and update you the result. 

 

Regards,

Ganesh 

Sure Ganesh

Do let us know if stuck anywhere.

Regards

Ankur

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

Community Alums
Not applicable

Hi Ankur,

One more question: how to pass sys_id of the problem to processing script to get the related incident? tried with couple of things but didn't worked.