Email notification from Workspace declarative action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 06:46 AM
Hi All,
I have created declarative action in workspace from here we need to change the state of incident and send an email to opened_by and their manager from workspace declarative form action.
Once the user clicked on form action button a modal will pop up and once they click on confirm button in modal, incident state should be change and email needs to send.
Could anyone help with the process or steps. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 08:58 AM - edited 07-23-2025 09:02 AM
For the email notification, follow the steps below:
Create an event in the Event Registry table .
Create a notification with the following details:
When to Send:
Table: incident
Send When: Event is fired
Who Will Receive:
Check the "Event parm 1 contains recipient" checkbox.
Check the "Event parm 2 contains recipient" checkbox.
What It Will Contain:
Add the content you want to include in your email notification.
In the Declarative Action's server script, you can update the state of the incident using the current object as shown below:
current.state = 'new_state';current.update();gs.eventQueue("event_name", current, opened_by, manager);If my answer has helped with your question, please mark my answer as accepted solution .
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 09:22 AM
Hi Priyanka,
Thanks for the response.
Small correction in my query - in declarative action a modal will popup in that there is cancellation reason text box and another CONFIRM button once that is clicked then mail need to be sent along with cancellation reason that is being stored in a field in incident table. In declarative action i selected UFX client action in implemented as ( Not server script or client script).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 01:45 PM
Hi @SaranGv ,
Please follow the above-mentioned steps 1 and 2 as they are. Then, use GlideAjax to call the Script Include, and make sure to fire the event within the Script Include
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 09:21 AM
You can use onChange client script and use g_modal API and then use GlideAjax to send the email via gs.eventQueue() in script include function
what did you start with?
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