Support & Docs
Powered by HelpSpot

2.6. Tasks2.php Explained

What does tasks2.php do?

The tasks2.php script has one primary function, it executes the automation rules defined in Admin->Tools->Automation Rules.

Each time tasks2.php runs all Automation Rules are run.

What are Automation Rules?

Automation rules allow you to define a set of conditions and when a request or requests meet those conditions to perform one or more actions on the matching requests.

Where is it located?

The tasks2.php file is in the root HelpSpot folder. The same one which contains admin.php and index.php.

How often should tasks2.php run?

In a new installation once a day is usually sufficient. More advanced automation rules may need to run more often. It's also possible to run a rule on it's own time schedule as described below.

How do I run the script?

On Linux/Unix the script should be run via Cron. On Windows Scheduled Tasks should be used. Windows users note that if you've installed using our Windows Installer a scheduled task has already been setup for you.

Configuration for Windows:
Remember that if you've used the HelpSpot Windows Installer this has already been done for you. You only need to setup Scheduled Tasks if you're manually installing HelpSpot on Windows.

See: VBS script for automated calling of tasks2.php

Configuration for Linux/Unix/OSX:
tasks2.php can be called directly through PHP on the command line or via an HTTP call. Several examples are below, but be sure to replace the generic paths with the ones for your installation:

Direct command line method for every minute (preferred):

* * * * * /usr/bin/php -f /path/to/helpspot/tasks2.php

Using HTTP with curl:

* * * * * curl http://www.domain.com/tasks2.php

Run an Automation Rule on it's own schedule

In some cases you may want to run a rule more often then the default tasks2.php schedule.

For example, a rule which escalates a request if it's been unanswered for more than 4 hours. In this case you would need to run the rule every few minutes to escalate the requests as soon as they turn 4 hours old.

To run just one rule via tasks2.php you need to know the rules ID. You can find the ID for an automation rule in Admin->Tools->Automation Rules

If you were using the HTTP method you would change the URL to:

http://www.domain.com/tasks2.php?id=3

If you were using the command line method you would do this:

* * * * * /usr/bin/php -f /path/to/helpspot/tasks2.php --id=3
This page was: Helpful | Not Helpful