"Recurring Tasks" module in Protection and Security Toolkit

Overview

This guide helps Confluence administrators to create recurring tasks in Data Protection and Security Toolkit for Confluence. You can use the Recurring Tasks module when it’s necessary to provide some recurring actions with the Confluence pages. Read our guide to find out how to set required parameters properly and in an easy way.

How to create a new task

Open the Confluence administration section using the settings button at the right top corner and choose any item in the dropdown menu. After that, you will see the sidebar — find the Recurring Tasks module and click on it. Now, you’ll see the Recurring Tasks Dashboard.

Recurring Tasks Dashboard

Find the New Rule button in the top right corner and click on it. The Task Creation page will show up:

Task Creation page

 

Here is an overview of the task parameters which you can set:

Parameter Name

Default Value

Description

Parameter Name

Default Value

Description

Enabled

Disabled

Enable the checkbox to activate the task.

Recurrent Task name

Empty

Enter the task name in this field.

Cron Expression

Empty

Set the periodicity of the task in cron format. You can find hints about cron expressions when you hover the “?“ sign.

CQL

Empty

Define the scope of the Confluence pages for which the task must run. Use CQL format for this field. You can find hints about the CQL format when you hover the “?“ sign.

Action

None

Select the actions to be performed with specific pages:

Send Notification: This action allows you to create an email associated with the pages and send it to specific users.

Add comment to the Page: This action allows you to create a comment on all pages of the scope.

Move page or blog post to trash: This action moves selected content to the trash. You can restore these contents if necessary.

Permanently delete page or blog post: This action deletes all pages of the scope.

Set page restrictions: This action allows you to define who can see the pages.

Reporting type

None

Set the reporting type if you want to receive the notification about running the task.

Send Notification: In this type, reports are sent by e-mail.

Print to atlassian-confluence.log: This type means writing the information to the server log.

 

Let’s take a look at the Action parameter values in detail:

Action Parameter value

Description

Action Parameter value

Description

Send Notification

When you choose this action, you can set the next parameters:

Notification grouping: If a user is the author of several pages, then by default there will be as many notifications sent as there are associated pages. You can avoid this by the grouping feature. Notifications can be grouped as follows:

  • By user: The user will receive only one notification about all related pages.

  • By space and user: If the user is a participant of several spaces, he will receive a notification for each space.

Select one of the options from the drop-down menu.

Select users for notifications: Select one of them from the drop-down menu:

  • Creator

  • Last modifier

  • Watchers

  • Space admins

  • External emails

If you want to send notifications to external emails, enter email addresses in the special Emails field below.

Subject: Enter the subject of your message.

Message: Enter the content of your message. You can use the $resultTable variable to display a table with some data in your message for the users.

Add comment to the Page

When you choose this action, you can set the comment text in a Comment field and this text will be displayed on all pages of the scope.

Move page or blog post to trash

When you choose this action, select one of the following options:

  • Move pages affected by CQL to the Trash and all the child pages (default option).

  • Move pages affected by CQL to the Trash only if all the child pages are affected by CQL also.

  • Move pages affected by CQL to the Trash and move up all the child pages to the nearest parent page.

Permanently delete page or blog post

When you choose this action, select one of the following options:

  • Delete page affected by CQL and all the child pages (default option).

  • Delete page affected by CQL only if all the child pages are affected by CQL also.

  • Delete page affected by CQL and move up all the child pages to the nearest parent page.

Set page restrictions

When you choose this action, you can set a user group that can see the page. Select the group in the field below.

Click the Save button at the top of the page when all parameters are set, and you’ll see the Dashboard again.

Recurring Tasks action menu

At your Dashboard, you can see all your created tasks and short information about them — name, state, creator, cron expression, and the last run time. For an enabled task, you will see the status “Enabled“ highlighted in green.

Find the Actions column and click on its button. After that, you will see the Actions menu. Using it, you can:

  • force the execution of the task by clicking the Run option,

  • navigate to the Edit page,

  • quickly enable or disable the task,

  • see the task history — you will find the last task run date, the result status, details about the performed action and the affected issues,

  • clone the task,

  • delete the task.

 

Typical usage scenarios

Let’s take a look at some typical scenarios of Recurring Tasks which you can use.

Add comment to the Page

It could be necessary to leave a comment for the Confluence pages. For example, you want to add a comment every month (at 00:00, on day 1 of the month) for all pages. To do this, create a Recurring Task with following parameters:

Parameter

Value

Parameter

Value

Enabled

Activated checkbox

Recurrent Task name

Set the name which you like

Cron Expression

0 0 0 1 * ?

CQL

type = page

Action

Add comment to the Page

Comment

Enter the text of your comment

Reporting type

None

After the task runs, users will see the comment at the bottom of pages:

 

Set Page restrictions

If you want to hide some pages from users, create a task with the Set Page Restrictions action.

For example, it’s necessary to restrict access to all pages which were created or modified in the last week and these pages must be available only for some moderators.

Create a group of users who will be able to see the pages, “restricted-group“ e.g., you will enter this name into a special field of the task settings.

After that, create a task recurring every Sunday with these parameters:

Parameter

Value

Parameter

Value

Enabled

Activated checkbox

Recurrent Task name

Set the name which you like

Cron Expression

0 0 0 ? *SUN*

CQL

lastmodified > now(“-1w“)

Action

Set Page Restrictions

Group who will be able to see the page

restricted-group

Reporting type

None

After the task runs, only the restricted groups will be able to read these pages.

Move page or blog post to trash

Use recurring tasks when it’s necessary to move some pages regularly.

For example, there are some pages with the label “todelete“ and you want them to be moved to trash every year. To do this, create a Recurring Task with these parameters:

Parameter

Value

Parameter

Value

Enabled

Activated checkbox

Recurrent Task name

Set the name which you like

Cron Expression

0 0 0 1 JAN ? *

CQL

label = “todelete“

Action

Move page or blog post to trash

Move pages affected by CQL to the trash

and all the child pages (default option)

Reporting type

None

After the task is executed, these pages will no longer be available in the Confluence.

 

 

Now you have an idea of how you can create recurring tasks easily and quickly with Data Protection and Security Toolkit for Confluence. If you have any further questions, we will be happy to help you! Simply contact us.