Jira Service Management Automation rules fail with the ERROR status and a "red exclamation mark"

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

   

Summary

In Jira Service Management (JSM) projects, it is possible to configure automation rules in Project Setting > Automation, as explained in the documentation Automating your service project. In some cases, the automation rule might fail to be executed. When checking the audit logs from this automation rule by going to the page Project Setting > Automation and clicking on the View log link, the following can be seen:

  • the status column shows an ERROR
  • when clicking on the show details link to expand the audit logs, a "red exclamation" mark is displayed in the IF or THEN section, without any detail, as shown in the screenshot below:

This KB article explains how to troubleshoot this type of automation failure, since the audit logs don't provide any detail about the failure.

(warning) Note that this KB article only applies to the JSM Automation module (configured in Project Setting > Automation), not with the automation module from the Automation for Jira add-on (which is configure in Project Settings > Project Automation). If you are using Automation for Jira, this KB article does not apply to you.

Environment

Jira Service Management (JSM) Server/Data Center 4.0.0 or any version above.

Diagnosis

Even though the audit logs don't show any detail about the failure in the UI, it is possible to extract from the Jira Database a message that should help understand why the automation rule failed. Here are the steps to retrieve the error message from the Database:

  • First, you'll need to get the automation rule ID from the UI. You can get this ID by going to the audit log page for this automation, and fetching the number located at the end of the URL after /automation/log/, as shown in the screenshot below:
  • Connect to the Jira Database and run the following SQL query.

    • (warning) Make sure to replace <AUTOMATION_ID> in the query below with the automation ID found in the previous step, before you execute it

    • (warning) The SQL query below was written and tested for a PostgreSQL database:

      select rule_ex."START_TIME_MILLIS", rule_ex."EXECUTOR_USER_KEY", then_act_ex."MESSAGE", then_act_ex."OUTCOME"
      from "AO_9B2E3B_RULE_EXECUTION" rule_ex
             inner join "AO_9B2E3B_RULE" rule on rule."ID" = rule_ex."RULE_ID"
             inner join "AO_9B2E3B_IF_THEN_EXECUTION" if_then_ex on rule_ex."ID" = if_then_ex."RULE_EXECUTION_ID"
             inner join "AO_9B2E3B_THEN_EXECUTION" then_ex on if_then_ex."ID" = then_ex."IF_THEN_EXECUTION_ID"
             inner join "AO_9B2E3B_THEN_ACT_EXECUTION" then_act_ex on then_ex."ID" = then_act_ex."THEN_EXECUTION_ID"
      where rule."RULESET_REVISION_ID" in (
        select ruleset."ACTIVE_REVISION_ID"
        from "AO_9B2E3B_RULESET" ruleset
        where ruleset."ID" = <AUTOMATION_ID>
      ) and rule_ex."OUTCOME" = 'ERROR';
    • (warning) For MS SQL Server, you can run the SQL below instead:

      select rule_ex.START_TIME_MILLIS, rule_ex.EXECUTOR_USER_KEY, then_act_ex.MESSAGE, then_act_ex.OUTCOME
      from AO_9B2E3B_RULE_EXECUTION rule_ex
             inner join AO_9B2E3B_RULE rules on rules.ID = rule_ex.RULE_ID
             inner join AO_9B2E3B_IF_THEN_EXECUTION if_then_ex on rule_ex.ID = if_then_ex.RULE_EXECUTION_ID
             inner join AO_9B2E3B_THEN_EXECUTION then_ex on if_then_ex.ID = then_ex.IF_THEN_EXECUTION_ID
             inner join AO_9B2E3B_THEN_ACT_EXECUTION then_act_ex on then_ex.ID = then_act_ex.THEN_EXECUTION_ID
      where rules.RULESET_REVISION_ID in (
        select ruleset.ACTIVE_REVISION_ID
        from AO_9B2E3B_RULESET ruleset
        where ruleset.ID = <AUTOMATION_ID>
      ) and rule_ex.OUTCOME = 'ERROR';
  • Check the MESSAGE column from the result of the query to understand why the automation rule failed 
  • Note that the query might return multiple rows, in case the automation rule failed multiple times. To make sure you pick up the relevant error message, you can convert the time from the START_TIME_MILLIS column from the Epoch unit to the human readable time format and compare this time to the time found in the audit log page

Examples of SQL query result

You can find below an example of result obtained from the SQL query:



In this example, we can see that the rule failed because of the error message "Issue transition validation failed". This error means that the automation rule was not able to execute the transition on behalf of the user who ran this automation, because this user was not allowed to execute the transition.

Cause

The reason why an automation rule fails to run and shows an "Red Exclamation mark" in the audit logs can vary a lot, depending on how the automation rule is configured.

Having said that, the most common scenario where an automation rule can fail is the one where the automation rule is configured to perform a workflow transition, and the user who ran the automation rule was not allowed to perform it. It could be because:

  • the transition was configured with a workflow condition that does not allow specific users to execute it 
  • the user who ran the automation rule was not granted the Transition Issues project permission in the JSM project

Solution

The solution will depend on how the automation rule is configured, and on the error message found in the SQL query.

In the scenario where the automation rule failed due to the error "Issue transition validation failed", to fix the issue, you can either:

  • review how the automation rule is configured via Project Settings > Automation > Edit and change the user which will execute the rule, by clicking on the Options button on the top right corner, as shown in the screenshot below. What you can do is change the setting to Run as project default, and ensure that the project default user is allowed to execute the transition
  • review the project permission scheme and make sure that the right users have the permission to transition issues in the project
  • review the transition configuration in the workflow and check if there is any condition that might prevent some users from executing the transition


Last modified on Feb 14, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.