- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 03:13 AM
Hi
I have requirement like whoever changing the field called state(field is on sc_req_item table) as pending then notification should trigger with that state field upated by name in the body of the notification(on sc_req_item). How can I get this one
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 04:42 AM
you will have to use email script for that. I hope you know how to do that or can search in docs for the same
1) create email script -> get_user
2) then include that in email body of your notification like this and print the content
${mail_script:get_user}
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord("sys_user");
gr.addQuery("user_name", current.sys_updated_by);
gr.query();
if (gr.next()) {
template.print("State pending Updated By : " + gr.getDisplayValue());
}
})(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
01-23-2025 03:17 AM
you can use flow designer for this
Run as : User who initiates the session
Trigger: State Changes to Pending
Use Send Email Action and send the email to the user who triggered the flow
It's a simple one
What did you start with and what didn't work?
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
01-23-2025 03:22 AM - edited 01-23-2025 03:25 AM
Hi @Ankur Bawiskar Thanks for the reply
Already I have created the notification when state changes to pending(From sc task state to RITM state its changing to pending) it will trigger the notification but I want to pull the user name who is changing that state to pending on that particular sc task ?
In the body of the email I want to get the below value:
State pending Updated By : {User name who updated the state to pending}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 03:27 AM
you can directly handle this using flow and no notification required
Flow will be on RITM table
please share what flow did you configure?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 03:32 AM
Hi @Ankur Bawiskar Thanks for the reply.
We are not using any flows for this one just sending an email when state changes to pending so :
In the body of the email I want to get the below value:
State pending Updated By : {User name who updated the state to pending}