Uploaded image for project: 'Automation for Jira Server'
  1. Automation for Jira Server
  2. JIRAAUTOSERVER-181

As a Jira admin, I would like to be able to temporarily stop all automation rules

    XMLWordPrintable

Details

    • 0
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Issue Summary

      When preparing a stage test environment with production data, we would like to have an option to temporarily disable all the rules, without the need to manually switch off each rule through the Gui Interface or disable the plugin.

      Steps to Reproduce

      1. Prepare a stage test environment using Production Data
      2. Check the Automation rules list and go one by one, disabling each rule
      3. Check the Service Desk Project Areas > Project Settings > Automation and disable each rule

      Expected Results

      • Have a single option that you could disable all the automation rules

      Actual Results

      • There is no UI option to disable all the rules. You need to go one by one

      Workarounds

      NB: The SQL below is written for PostgreSQL, and will need syntax tweaking for other DBs

      Disabling all rules in the database

      To disable all A4J rules, run this SQL against your database, and restart Jira to pick up the change:

      -- disable all A4J rules
      update "AO_589059_RULE_CONFIG" set "STATE" = "DISABLED";
      

      Selectively disabling A4J rules that communicate with other services in the database

      If you would rather selectively disable rules that communicate with production systems, you can disable all rules that have outgoing webhooks or communicate with Slack. 
      This option can be useful if you prefer to leave other A4J rules which do not communicate with external systems enabled for testing.

      -- disable all A4J rules with outgoing webhooks
      update "AO_589059_RULE_CONFIG" set "STATE" = "DISABLED" where "ID" in (select "RULE_CONFIG_ID" from "AO_589059_RULE_CFG_COMPONENT"
                          where "TYPE" = 'jira.issue.outgoing.webhook');
      -- disable all A4J rules which send slack notifications
      update "AO_589059_RULE_CONFIG" set "STATE" = "DISABLED" where "ID" in (select "RULE_CONFIG_ID" from "AO_589059_RULE_CFG_COMPONENT"
                          where "TYPE" = 'slack.notification');
      

      NB: You will need to restart Jira after making these changes in the database.

      Tip: to find other rule actions that are in use:

      select distinct("TYPE") from "AO_589059_RULE_CFG_COMPONENT";

      Setting limits

      Following the Service limits knowledge base, temporarily set the property "max.processing.time.per.day" (default 3600) to a very small value, like "1", forcing all the automation rules to be throttled. The rule will start, but as the limit was reached, it will be interrupted.

      You can run a curl command like the one below, replacing your user, password and jira base URL:

      curl -X PUT -H 'Content-type: application/json' \
      -u user:password \
      -d '{"key": "max.processing.time.per.day", "value": "1"}' \
       http://jirabaseurl/rest/cb-automation/latest/configuration/property

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              imurakami@atlassian.com Murakami
              Votes:
              31 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated: