Defects auto-created from change requests keep duplicating in release

Our release pipeline is completely blocked due to a bizarre defect duplication issue. We have a custom rule that auto-creates defects when change requests are approved, but every single approval is now generating 3-5 identical defects instead of one.

The rule fires on ChangeRequest state transition to “Approved” and creates a defect with the CR details. Here’s the rule logic:

if (changeRequest.State === 'Approved') {
  createDefect(changeRequest);
}

This worked perfectly for months until our Rally 2024 upgrade two weeks ago. Now our defect backlog is flooded with duplicates, and we can’t distinguish real issues from automation noise. The duplicates have identical titles, descriptions, and timestamps - down to the second.

I suspect custom rule caching might be involved since the duplication count seems random (sometimes 3, sometimes 5). Has anyone seen this behavior after upgrading to Rally 2024?

We hit this exact issue. The problem is that Rally 2024 introduced rule caching at the session level, and if your rule doesn’t check for existing defects before creating new ones, it will create duplicates on every cache refresh. You need duplicate prevention logic in your rule.

That makes sense - our rule has zero duplicate checking. It just blindly creates a defect whenever it sees State=Approved. I’m assuming we need to query for existing defects linked to the ChangeRequest before creating a new one? What’s the recommended approach for this?

Also check if you have multiple custom rules that could be triggering simultaneously. We discovered we had three different rules all trying to create defects from change requests, and they were all firing at once in Rally 2024 due to the new parallel rule execution engine.

Correct approach is to add a guard clause that queries for existing defects with the same ChangeRequest reference. Rally 2024’s rule engine caches the ChangeRequest object state, so multiple rule evaluations can occur during a single transaction. Always implement idempotency checks in your custom rules.