diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDefinitionDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDefinitionDto.java
index <HASH>..<HASH> 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDefinitionDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDefinitionDto.java
@@ -107,6 +107,7 @@ public class RuleDefinitionDto {
   public RuleDefinitionDto setRuleKey(RuleKey ruleKey) {
     this.repositoryKey = ruleKey.repository();
     this.ruleKey = ruleKey.rule();
+    this.key = ruleKey;
     return this;
   }
SONAR-<I> fix RuleDefinitionDto#setRuleKey not reseting cached ruleKey