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?

  • Are all the relevant fields on the right screens in Jira?

  • Compare the edits in the audit log with the issue history tab on the issue page.

  • 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.

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, e.g. {{#debug}}{{issue.fields.description}}{{/}}.

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 to execute a rule from an issue at any time.

  • Use the Scheduled trigger and click Run rule to trigger the rule for testing.

  • Use the smart value {{now}} to include the current time in your issue fields. This allows you to see when the edit was made and if the value changed.

Last modified on May 12, 2021
Cached at 3:49 PM on Dec 5, 2021 |

Additional Help