Debug an automation rule

If a rule isn’t behaving as expected, the following information can help you troubleshoot and resolve issues.

1. Check the audit log

Checking the audit log should be your first step when a rule is failing. When reviewing the audit log:

  • Check for any displayed errors. If there are errors, do they offer any suggestions or instructions on how to fix the problem?

  • If there are no entries and you were expecting some, you either haven’t configured the trigger correctly, or the trigger has a filter on it which isn’t behaving as you expect.

  • Compare the edits in the audit log with any historical information you can find in the product (e.g. the issue history in Jira, or the page history in Confluence).

  • For Jira automation, make sure all the relevant fields on the right screens in Jira?

Learn how to access the audit log.

2. Debugging smart-values

Use the Log action

The Log action adds values into the audit log, including smart values. This can be useful when testing complex smart-value functions.

1 2 3 Log message: This should evaluate to 2: {{#=}}1 + 1{{/}}

 

"Log" action for an automation rule. The value "{{#=}}1 + 1{{/}} should equal to 2" is entered in the "Log message" field

Use debug

Using the Log action requires you to add an additional component to your rule. To avoid this, you can use the {{#debug}} function.

Surrounding any smart value with debug, allows the smart value to be processed as normal and also prints the value in the audit log to provide more contextual information.

1 {{#debug}}{{#=}}1 + 1{{/}}{{/}}

When this rule now executes, the audit log will contain:

1 2 Debug message 2
Audit log for an automation rule. The rule has a status of "Success" and shows "Debug message 2.

3. Make the testing easy & clean

  • Copy the rule and disable the original before testing. This allows you to revert to the original rule easily if you make changes.

  • Use the Manual trigger (Jira only) to execute a rule from an issue at any time. You can also use the Scheduled trigger to run a rule for the purposes of testing.

  • When testing an action that enters a value, use the smart value {{now}} to include the current time. This allows you to see when the edit was made and if the value changed.

Still need help?

The Atlassian Community is here for you.