- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 03:43 PM
Hello,
In the email notification, I want to attach a policy document.
I was wondering what was the reason behind not including attach document option straightforward in the email, instead I'm able to attach an image or video. (Image below)
Need your advise on the best practice:
1. Where should I upload this document in ServiceNow?
2. How can I just refer it to the email notification.
I have gone through some responses on attaching your incident attachments using some script. In my case, this is a independent document.
Appreciate your help.
Thanks,
Krishna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 09:38 PM
If you want to include some information from the parent record, we need to add a bit of scripting to the Notification. In the Workflow, you will want to add the sys_id of the Integrity record that is triggering the event into the "parm2" parameter (the last parameter in the following call to eventQueue):
gs.eventQueue("x_grs_compliance.investigation.policy", gr, "test@gmail.com", current.getValue("sys_id"));
Now that we are passing on the sys_id, we need to query the Integrity table to get the record and output the information we need. That will be done in 2 parts:
- add a call to a Notification Email Script into the body of the Notification
- create a new Notification Email Script
The script just searches for the Incident record and then uses template.print to output the required data from the Incident record.
I built the example above off the Incident table so you just need to change the table name and then add your fields for your purpose. That should do it for you. I ended up with an email like so:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 04:04 PM
This article may help - Sending Documents in an Email Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 07:57 AM
Hello Jim,
Thank you for your response. I'm getting the attachments from kb_knowledge.
However, I'm unable to display the current record values of my workflow along with the attachment. Since the current record is from kb_knowledge.
The below script is triggered from workflow. The workflow triggers on Integrity table and I want to display the current values of Integrity values along with the attachment from kb_knowledge.
Please see my configuration below -
Email output shows blank values:
How can I pass the current records values to the event that I fire? Thank you.
Regards,
Krishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 02:43 PM
KIndly appreciate if anyone can help on this. If I cannot attach the document, I want to able to keep a link to the policy document atleast in the email.
I tried that by creating a article in knowledge with article as attachment.
And I kept the link in the email.
https://xxxxxxx.service-now.com/sys_attachment.do?sys_id=b1ac0fa7db99fa003a22fbb9af96190b
This works fine but it doesnt look like a best practice as I have to do the same manually in TEST & PROD systems.
Can someone suggest the best practice to have the policy document link in the email and where should I actually have the file?
OR would be great if I can attach the document directly on how Jim suggested.
Appreciate your help.
Thank you,
Krishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 09:38 PM
If you want to include some information from the parent record, we need to add a bit of scripting to the Notification. In the Workflow, you will want to add the sys_id of the Integrity record that is triggering the event into the "parm2" parameter (the last parameter in the following call to eventQueue):
gs.eventQueue("x_grs_compliance.investigation.policy", gr, "test@gmail.com", current.getValue("sys_id"));
Now that we are passing on the sys_id, we need to query the Integrity table to get the record and output the information we need. That will be done in 2 parts:
- add a call to a Notification Email Script into the body of the Notification
- create a new Notification Email Script
The script just searches for the Incident record and then uses template.print to output the required data from the Incident record.
I built the example above off the Incident table so you just need to change the table name and then add your fields for your purpose. That should do it for you. I ended up with an email like so: