Report Not Being Added to Email Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 08:16 AM
I am still fairly new to the platform and learning how to configure. I recently was tasked to setup a notification that includes a report when it is sent based on the condition that specific CAB meetings are marked complete. At first the report was being added but was showing "the sender does not have access". I changed the scheduled job for this report to run as the change manager and granted them the role of "report_scheduler", but now the report is not being included at all. I also made sure to share the report with the change manager as I created it with my admin account.
In the "what to include" field I have it set content type = HTML only and have "include attachments" checked. In the body I have included the code below where sys_id is the report_id.
${report:reportID:<sys_id>}
Any ideas as to why the report is not being included? Or do I need to replace the report_id with the sys_id of the scheduled report instead?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 09:40 AM
You dont need ${report:reportID:<sys_id>} in the body.
If it is just one report, your scheduled report will have a report field where you enter the report you want to attach. Then it should attach the report to the email.
You can run the job as admin user.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 11:09 AM
I appreciate your timely response! However, my reasoning for sending it as a notification was that I only want to send this report when a CAB meeting is updated to completed. I am not familiar with java script so this allowed me to use the variable pickers. How would I translate the attached to be an "on demand" condition for my scheduled report?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 01:15 PM
So this is what you can do when state changes to Complete. You can create a Business Rule to create a scheduled report which will trigger the email to send a report
var scheduled_report = new GlideRecord('sysauto_report');
//Set the scheduled job to active
scheduled_report.active = 'true';
//We add report title and user name to the name for clarity
scheduled_report.name = <attachmentName>;
//Run report as given user to show only his records
scheduled_report.run_as = gs.getUserID();
//Sent report to same user, so he receives his own report
scheduled_report.user_list = <Email id/sys_id of the user>;
//Only send the report once
//It will be rescheduled if needed
scheduled_report.run_type = 'once';
scheduled_report.report_title = <email subject>;
scheduled_report.report_body = 'Report attached ' + attachmentName;
scheduled_report.report = <report_id>;
scheduled_report.output_type = <attachmentType>;
//Now, insert the newly created scheduled job to start running
//As it is a "once" job, it will run automatically
var answer = scheduled_report.insert();
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2025 02:21 PM
I have to use a notification that is triggered by an event because the emails are dynamic based on a column from another table but the preview isn't showing the report. Or is this either not something that the preview can do (i.e. it has to actually be run) or how can I tell that the report is run while still in a development environment?