FogBugz Plugin Interfaces > FogBugz Periodic Maintenance > IPluginDailyTask
Introduction
This article will demonstrate a simple FogBugz plugin that implements the IPluginDailyTask interface contained in the FogCreek.FogBugz.Plugins.Interfaces class library.
Note: in any action that takes place during periodic maintenance, plugin code which loads FogBugz entities should assume it has only Public permissions. If your code needs to access and modify entities, use .IgnorePermissions as described here: Entity Member Security. When IgnorePermissions is set to true, heartbeat tasks have site admin permissions.
Functionality
This plugin will add an administrator notification every time the daily tasks are run by heartbeat.asp. For testing purposes, you can force FogBugz to run its daily tasks by updating the appropriate row in the Setting table. The following SQL sets the last daily task date and time to the past:
UPDATE Setting
SET sValue = '2009-01-01 06:00:00'
WHERE sKey = 'dtLastDailyTask'
The familiar notification for logged-in administrators:
The notification added by this plugin:
Compile and Install It On Your Own
Download the source file: IPluginDailyTask_Example.cs
Then follow these instructions to create a functioning plugin assembly: Compiling and Installing a FogBugz Plugin