- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 05:01 AM
Hi All,
I have created a flow which should be doing the following
When a new record is created and assigned to assignment group "A" OR an existing incident is assigned to assignment group "A" an email should be sent to assignment group "A"
I would expect to see the e-mail once sent to be viable in the activity log (as you can see in screenshot for incident creation to end user)
Any assistance on what is incorrect here?
Would it be better to have 2 flows one for new incidents (would this be new as in just created or first time assigned to RG) and one for updates?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 06:19 AM
Even with the code "Send email" action is throwing an error. Instead use "Send Notification" action.
- Create a notification
-Add your user email id & click add email address
-Add ${mail_script:email_script_name} in body & save the record
- Create "Email Script" & add the below code
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var desc = current.description;
var start = desc.indexOf("Short Description of Issue:");
var end = desc.indexOf("AUTH-4063");
var extractedText = desc.substring(start, end).trim();;
template.print(extractedText);
})(current, template, email, email_action, event);
- Add notification in flow
Result:
If my answer helped you in any way, please mark it as helpful or correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 05:44 AM - edited 05-21-2024 05:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 06:22 AM
@Kieran Anson @Community Alums
Seem to have found the issue. its with regards to the description field I'm trying to pull into the email.
for this particular record I am trying to get the description from the record - the description is generated from an inbound email action. the issue is that sometimes the inbound email may have signatures, links etc and thats causing the ServiceNow generated email to the supplier to error.
Is there a way I can edit the Description field to pull only a section from the "Description" into the email?
Please see screenshot below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 06:31 AM
Great!
if you hover on the description then fx will be visible. Try to check if any one of the functions satisfies your requirement. Else, use in-line script
If my answer helped you in any way, please mark it as helpful or correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 06:40 AM
I am quiet new to this, based on my screenshots and the information i need to pull - is there any of the functions you feel would be best suited and easiest to configure as I am struggling to get it correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 06:47 AM - edited 05-21-2024 06:48 AM
Sure, can you please let me know which part of the description do you want to send? And also please paste the description here, it will be easy for me to replicate.
Replace any confidential data with some random text