Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


It isn't always obvious why a rule is failing. Here is a guide to what we do when trying to debug why a rule is not behaving as expected.

1. Check the Audit log

We always try to capture problems in the Audit log. This should always be the first port of call.

  • Are there any errors displayed?
  • Do they provide instructions on how to fix the problem?
  • Can you click through to the component and fix it?
  • Compare the edits in the Audit log with the issue history tab on the issue page.

Image Removed

If there are no entries when you were expecting some, either you haven't configured the trigger correctly or there is some nastier bug at play.

2. Use the "Log action"

We are always doing this. The "Log action" will render any value (including smart-values) into the Audit log. This is great when you are trying to debug smart-values and you aren't sure what they are outputting.

Image Removed

3. Make the testing easy & clean

Some other great tips:

  • Copy the rule and disable the original before testing. This allows you to revert to the original issue if you make lots of changes.
  • Use "Manual triggers" to easily trigger rules from an issue.
  • Use "Schedule triggers" and simply click the "Run rule" button to trigger the rule for testing.
  • Use {{now}} to include the current time in your your smart fields. e.g. description. This allows you to see when the edit was made and if the value changes.
  • If you are creating rules, you can also use the "Delete action" to clean the issue up after.
  • When debugging embedded smart-values, break out each part and print that out using the Log action.

 4. Other add-ons not playing nicely

We have recently seen a lot of support cases where 3rd party add-ons are causing problems in Automation. They can throw errors while handling events or while serializing an issue (we need to convert the issue to JSON to push it through the Automation engine). Calculated custom fields can also cause performance issues. Some add-ons we've seen cause issues are:

  • ScriptRunner
  • Jira Suite Utilities
  • Jira Misc. Customfields
  • Powerscript

If you are seeing issues around performance or rules not running and you have any of these add-ons installed, try disabling them to see if the problem goes away.

Info
If you still don't know why the rule isn't working, create a support ticket

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@73c02c85
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("automation","debug","debugging","rules") and type = "page" and space = "AUTO4J"
labelsrules automation debug debugging

Related issues
Page Properties
hiddentrue
Info

Our documentation has recently move to a new location! Please head on over to: https://docs.codebarrel.io/automation/overview/debugging-a-rule.html