Defining time-based rules


You can define rules that run at specific intervals and perform an action based on the results. For example, you can define a rule that runs every hour, checks for tickets that contain certain values in the Title and change their Priority.

You specify intervals in minutes, hours, days, weeks, or months. You cannot select a value for an interval that is greater than the maximum for that interval because the utility that manages time-based triggering starts afresh with each new interval. Maximum values, therefore, are 59 for minutes, 24 for hours, 31 for days, 52 for weeks, and 12 for months.

For example, to run a report every so many hours, you can enter any value from 1 to 24, but not larger values. If you enter an invalid value, the system generates an error message when you save the rule.

Rules are based on the time zone of the system server. Hour values are expressed in military format (for example, 1600 represents 4:00 P.M.). However, 16 represents 16 hours from the start of the work schedule day.

Triggers scheduled for every other day or every other week start afresh on the first day of the month. In production, this means that the first report of a month might occur sooner than expected based on the last report of the previous month. For example, if you run a report every other day and the last report runs on the last day of a month, the next report will run on the first day of the next month because the cycle begins afresh every month.

Use caution when selecting values that will trigger the rule very frequently as this may slow performance.

Best practice
To avoid performance issues:

  • Do not schedule time-based rules to update a large number of tickets at the same time.
  • When you define a time-based rule, consider how it might affect the application data in the production instance.
  • If an existing time-based rule might impact a significant number of tickets, consider replacing it with additional business rules to achieve the same result. Updating too many tickets at the same time during business hours might cause performance issues.
  • Schedule time-based rules to run outside of business hours, especially the ones that might impact many tickets. Updating too many tickets at the same time can cause performance problems for other users of the system.
  • Do not schedule multiple time-based rules to run at the same time.
  • Make sure that you configure an appropriate schedule for a business rule. For example, do not configure a business rule to run every 15 minutes if you can meet the business need by running it once a day.

To define a time-based rule

  1. Open the container and item where you want to define the rule:
    1. Click the Administration tab.
    2. In the appropriate section, click the name of the container, or click Manage to open the container Administration page. Then double-click the container.
      The container details page appears.
    3. In the left pane, click the item link (such as Record Definitions in workspaces).
      The Items page appears. 
    4. Double-click the item that you want to modify.
      The Item details page appears.
  2. In the left pane, click Business Rules.
  3. Click New Business Rule and select the appropriate rule type.
    The Rule Builder page appears. For detailed information about configuring different types of rules, see Types-of-business-rules.
  4. In the Business Rule Name field, enter a descriptive name for this rule.
  5. (Optional) In the Description field, type a useful description.
  6. In the Business Rule Schedule field, accept the default of Run Any Time or select a work schedule defined for the container.
  7. In the Triggers section:
    1. Click Add new trigger.
    2. In the Available triggers field, select Time based.
    3. In the Frequency field, select how often you want the rule to fire, such as checking every hour.
    4. In the next fields, enter the values for the selected interval such as selecting a day of the week, an hour, and a minute.

      Important

      You can set the schedules for triggering business rules based on different interval values as follows:

      • If the value in the Frequency field is Monthly, the trigger follows the value set in the Every # of Months field. However, the trigger resets every January.

        Example

        On June 1, 2022, at 10:00 A.M., you set a rule as follows:

        Field

        Value

        Frequency

        Monthly

        Every # of Months

        6

        On Day of the Month

        5

        At Hour

        10

        The schedule for triggering the business rule is as follows:

        1. Monday, December 5, 2022 at 10:00 A.M.
        2. Thursday, January 5, 2023 at 10:00 A.M.
        3. Wednesday, July 5, 2023 at 10:00 A.M.
        4. Friday, January 5, 2024 at 10:00 A.M.

        The business rule is first triggered on December 5, 2022, six months after you set the schedule. The rule then resets to trigger on January 5, 2023, after which it follows the set interval of six months and is triggered on July 5, 2023 and so on.

      • If the value in the Frequency field is Daily, the trigger follows the value set in the Every # of Days field. However, the trigger resets on the first day of each month.

        Example

        On January 1, 2022, at 10:00 A.M., you set you set a rule as follows:

        Field

        Value

        Frequency

        Daily

        Every # of Days

        17

        At Hour

        10

        The schedule for triggering the business rule is as follows:

        1. Tuesday, January 18, 2022 at 10:00 A.M.
        2. Tuesday, February 1, 2022 at 10:00 A.M.
        3. Friday, February 18, 2022 at 10:00 A.M.
        4. Tuesday, March 1, 2022 at 10:00 A.M.
        5. Friday, March 18, 2022 at 10:00 A.M.

        The business rule is first triggered on Tuesday, January 18, 2022 at 10:00, 17 days after you set the schedule. The rule then resets to trigger on Tuesday, February 1, 2022 at 10:00 A.M. after which it follows the set interval of 17 days and is triggered on Friday, February 18, 2022 at 10:00 A.M., and so on.

      • If the value in the Frequency field is Hourly, the trigger follows the value set in the Every # of Hours field. However, the trigger resets every midnight.

        Example

        On January 1, 2022, at 10:00 A.M., you set you set a rule as follows:

        Field

        Value

        Frequency

        Hourly

        Every # of Hours

        10

        The schedule for triggering the business rule is as follows:

        1. Saturday, January 1, 2022 at 8:00 P.M.
        2. Sunday, January 2, 2022 at midnight.
        3. Sunday, January 2, 2022 at 10:00 A.M.
        4. Sunday, January 2, 2022 at 8:00 P.M.
        5. Monday, January 3, 2022 at midnight.

        The business rule is first triggered on Saturday, January 1, 2022, at 8:00 P.M., 10 hours after you set the schedule. It then resets to trigger on Sunday, January 2, 2022, at midnight, after which it follows the set interval of 10 hours and is triggered on Sunday, January 2, 2022, at 10:00 A.M., then again at 8:00 P.M., and so on.

    5. Click Create.
  8. In the Criteria section:
    1. Click Add new condition.
    2. In the first field, select the field that you want to be used for this rule.
    3. In the Contains field, accept the default value of contains.
    4. In the Value field, enter the value that will trigger this rule.
    5. Click Create.
  9. In the Actions section:
    1. Click Add new action.
    2. In the Action field, select the action that you want to be performed when this rule is triggered.
    3. In the next field, select the field that will be used by this rule.
    4. In the Value field, enter the value or formula for this rule. If you want to use field name variables, select them from the Field Variables list and click Insert.
    5. Click Create.
  10. Click Save.
  11. Publish the container to implement your changes:
    1. In the breadcrumb trail, click the container link.
    2. Click Save and Publish.

      A confirmation message appears.

    3. Click Yes.

      The Publication Succeeded message appears, showing the number of errors and warnings.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*