-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
None
-
Affects Version/s: 9.2.0
-
Component/s: Rule execution (engine)
-
Severity 3 - Minor
-
20
Issue Summary
When a rule with multiple projects has an archived project in scope, that rule fails to execute.
This is described in details in The Automation Rule fails if the rule includes an Archived project - Automation for Jira - Atlassian Documentation
Another side effect of having an archived project in the rule scope is that it will be impossible to save the rule in some cases (due to the project permission check), as described in the KB article Cannot enable or save Automation rule due to the error "Either you or the rule actor for this rule is missing some required permissions".
Steps to Reproduce
Scenario 1:
- Set up a new Jira Software Data Center 9.12.12 with Automation for Jira 9.0.3.
- Create two projects with sample data.
- Create a new rule: "When the custom field Priority is changed, add a comment to the issue." Set the project scope to these two projects.
- Edit one issue to trigger the rule to make sure it is working well.
- Archive one of the projects.
- Edit one issue to trigger the rule again, and it is still working well in Automation for Jira 9.0.3.
- Upgrade Automation for Jira to 9.2.0.
- Edit one issue to trigger the rule, and now it fails.
Scenario 2:
- Set up a new Jira Software Data Center 9.12.12 with Automation for Jira 9.2.0.
- Create 2 projects.
- Create a rule and set the scope as the 2 projects.
- Test and verify the rule is working well.
- Archive one of the projects.
- Test again and the rule fails.
Expected Results
The rule works and fails only when trying to manipulate archived issues
Actual Results
The rule fails with the error:
Either you or the rule actor for this rule is missing some required permissions
Workaround
Remove the archived projects from the rule scope.
To find all the rules that reference a project, you can run this query, replacing PROJKEY by the actual project key:
SELECT rc."NAME",p.pname,p.pkey FROM "AO_589059_RULE_CONFIG" rc JOIN "AO_589059_RULE_CFG_PROJ_ASSOC" rcpa ON rc."ID"=rcpa."RULE_CONFIG_ID" JOIN project p ON p.id=CAST(rcpa."PROJECT_ID" AS INT) WHERE p.pkey='PROJKEY'
To identify the list of all the automation rules which are using an archived project in their scope, you can run the following SQL query below:
SELECT rule_project_assoc."RULE_CONFIG_ID", rule_config."NAME", p.id, p.pname, p.pkey FROM propertyentry pe JOIN project p ON pe.entity_id = p.id JOIN "AO_589059_RULE_CFG_PROJ_ASSOC" rule_project_assoc ON p.id = CAST(rule_project_assoc."PROJECT_ID" AS INT) JOIN "AO_589059_RULE_CONFIG" rule_config ON rule_project_assoc."RULE_CONFIG_ID" = rule_config."ID" WHERE property_key = 'jira.archiving.projects' ORDER BY rule_project_assoc."RULE_CONFIG_ID";
These queries were made on PostgreSQL. Other DB engines might require removing the double-quote characters and possibly other adjustments.
- relates to
-
AUTO-441 Archiving or Deleting a Jira Project results with failure in automation rule failing
-
- Gathering Impact
-
-
JIRAAUTOSERVER-832 Automation rule should provide correct error message when rule scope has an archived project
- Gathering Interest
- links to