I set this up as per the online documentation, as follows:
Setup and test
By default, you’ll find a link to the application under main menu All Applications > Reporting Tools.
This tool lets you configure, run, export and save previously generated reports. We’re going to use the report “Recently modified”, so let’s click on the Open button (upper left corner) and select the appropriate item.
We have to choose the root item, usually “content\home”, because we want to get the modified items. Now just press “Run” on the top menu bar and there is our list of modified items. If you’re an admin, it is possible to export all that valuable information as a .csv, .xls (or html file, but with a Microsoft Excel extension), or .xml by clicking on the button “Export”.
- Using the above steps create the following reports:
- [/sitecore/system/Modules/ASR/Reports/Broken Links/GLOBAL_GENERAL-BROKEN-LINKS_ASR] item using the [/sitecore/templates/System/ASR/Saved Report] template
- Publish the [/sitecore/system/Modules/ASR/Reports/Broken Links/GLOBAL_GENERAL-BROKEN-LINKS_ASR] item to all publishing targets
- [/sitecore/system/Modules/ASR/Reports/Broken Links in publishable items/GLOBAL_PUBLISHABLE-BROKEN-LINKS_ASR] item using the [/sitecore/templates/System/ASR/Saved Report] template
- Publish the [/sitecore/system/Modules/ASR/Reports/Broken Links in publishable items/GLOBAL_PUBLISHABLE-BROKEN-LINKS_ASR] item to all publishing targets
Once our report is ready, we only have to save it, so it can be run selecting the parameters manually. But what happens behind the scenes? By default, all the preconfigured items are stored under “/sitecore/system/Modules/ASR/Reports”. Now, the application has saved our “report” as a child of the “/sitecore/system/Modules/ASR/Reports/Recently Modified”, using the template “/sitecore/templates/System/ASR/Saved Report”. So, what we’ve saved is not a report, just a “report parameter set” associated to a report.
Set up the task to be done by the scheduler
In order to have the schedule execute the task, we need a specific item. The ASR comes with a template to simplify this task under “/sitecore/templates/System/ASR/Report Email Task”. So, let’s select the commands folder under “/sitecore/system/Tasks”, right click and “Insert from template”, on the next window, we have to choose the mentioned item “/sitecore/templates/System/ASR/Report Email Task”. We must fill the fields under the “report Email section”.
- Active: If the report must be executed.
- To, Subject and text: The properties of the email to be sent.
- Send if empty:By default, the application won’t send the email, if after running the report, it returns 0 items. If you want to send the email anyway, mark this option.
- Report: Here we can choose all the reports we need on the same email. Notice, it will only run “Saved Reports” because you can’t run reports without parameters.
it] and the task is ready.
- Using the above steps create the following [Tasks/Command] item:
- [/sitecore/system/Tasks/Commands/Broken-Links_ASR-Reports] item using the [/sitecore/templates/System/ASR/Report Email Task] template, and ensure the fields for this item is populated as follows:
- [Data Section]
- [Type] : [ASR.Commands.ScheduledExecution,ASR]
- [Method] : [EmailReports]
- [Report Email Section]
- [Active] : [Checkbox => Checked/True]
- [From] : [email@example.com]
- [To] : [firstname.lastname@example.org]
- [Subject] : [RE: ASR Report for broken links]
- [Text] : [Empty]
- [Send if empty - by default it will not send reports with no results] : [Checkbox => Checked/True]
- [Reports] :
- [All => Multi-list field] : [GLOBAL_GENERAL-BROKEN-LINKS_ASR]
- [Selected => Multi-list field] : [GLOBAL_PUBLISHABLE-BROKEN-LINKS_ASR]
- Publish the [/sitecore/system/Tasks/Commands/Broken-Links_ASR-Reports] item to all publishing targets
Schedule the task
The specific ASR steps are done. Now we only need to set up the default Sitecore Schedule Item. Select the “Schedules” folder under “/sitecore/system/Tasks/Schedules”, right click à Insert à Insert Schedule. On the Command field, choose the command created in the previous step. On the Schedule field, we set up when to run the command. This field is a bit strange: I will explain it with an example. In the value ||127|23:59:59 each “|”, is a separator; the first value, is blank and would normally be the first day to run the task in yyyyMMdd format. The second is the last day; again, this is blank because it means the task will be executed indefinitely. The third one is the day of the week, 127 means every day. Why? 1=Sunday, 2=Monday, 4=Tuesday, 8=Wednesday, 16=Thursday, 32=Friday, and 64=Saturday, so everyday =1+2+4+8+16+32+64=127, and the fourth parameter is the minimum interval between invocations. 23:59:59 means once a day. Obviously, the report will not be executed at exactly the same time every day, but this is the best approach. If we try to use 24:00:00, the system will translate it to 00:00:00, so the task will be executed every second. That’s it; Sitecore will run the report and send the result via email, once a day. You can read more about scheduling a task on Sitecore here
- Using the above steps create the following [Tasks/Schedule] item:
- [/sitecore/system/Tasks/Schedules/Broken-Links_ASR-Reports] item using the [/sitecore/templates/System/Tasks/Schedule] template, and ensure the fields for this item is populated as follows:
- [Data Section]
- [Command] : [Commands/Broken-Links_ASR-Reports]
- [Items] : [Empty]
- [Schedule] : [20180508|20480508|127|01:00:00]
- [Last run] :
- [Now]: [Empty] => [Empty]
- [Async] : [Checkbox => Checked/True]
- [Auto remove] : [Checkbox => Unchecked/False]
- Publish the [/sitecore/system/Tasks/Schedules/Broken-Links_ASR-Reports] item to all publishing targets
For additional Documentation on Sitecore Task Scheduler component, please go to [Sitecore Task Scheduler Component].
At this point, you may have realized that the report will send you the email with the items modified since any given day we chose, but what if we want the items modified yesterday or last week? Well, this is possible too. We have to modify the “Saved report”, so let’s go to: “/sitecore/system/Modules/ASR/Reports/Recently Modified” and click on the item created in step 3. There’s only one field, with all the parameters of the report separated by the character “^”. Find the parameter AgeISO and replace the value with one of these variables:
This should work however it is not emailing me the report. Can anyone help guide me, I feel I may be missing a step....