Automation rule for issue *removal* from active sprint

Alex Ball February 25, 2021

Which automation rules should be used to trigger an action when an issue is *removed* from an active sprint?

This is easy for *addition* to an active sprint:

  • When: Value changes for `Sprint`
  • If: Issue matches JQL `Sprint in openSprints()`

I've tried several variations for the sprint-removal case, like:

  • When: Value changes for `Sprint`
  • If: Issue matches JQL `(Sprint is EMPTY OR Sprint not in openSprints()) AND {{fieldChange.from}} in openSprints()`

But I haven't found a way for Automation to play nicely with previous values of a multi-value field. `fieldChange.fromString`, `changelog.sprint.from`, etc... no dice.

Is this possible?

Thanks!

2 answers

1 accepted

3 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2021

Hi @Alex Ball 

There are suggestions in the Code Barrel backlog to detect sprint scope changes as a trigger, and Jira backlog to do so with JQL: 

I believe there is a ScriptRunner function to detect scope changes, if you have that add-on: removedAfterSprintStart.

Without those things...

Have you tried to shorten your JQL condition?  This worked for me:

  • Trigger: value changes for Sprint
  • Condition If issue matches JQL: 
key = {{issue.key}} AND Sprint IS EMPTY OR Sprint NOT IN openSprints()
  • Action: log the issue was removed from the sprint

 

Best regards,

Bill

Alex Ball February 25, 2021

Thanks, Bill! I'll keep tabs on those backlog issues.

Unfortunately, `Sprint is EMPTY OR Sprint not in openSprints()` doesn't quite do it, since we put "top of backlog" issues in four future sprints, each representing a different category (infrastructure, sales requests, bugs, etc.) for better visibility into sprint budgeting. Thus, that rule would trigger when moving an issue from one future sprint to another, which we don't want. AFAIK this means that we need access to the previous sprint value, to ensure that the issue was removed from the *active* sprint.

Bit of a niche case, I know. I'll give ScriptRunner a spin shortly.

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2021

Hmmm... I tried moving from the active sprint to both the backlog and future sprints, which worked for me.  The problem edge case is when you have parallel, active sprints.

One work-around for the future-to-future scenario: when a sprint starts, mark all issues that were in scope at that time (comment, custom field, etc.) using a different rule.  Then in your removal-detect rule, add a condition to look for that that marking so you wouldn't continue for the move of future sprint A to future sprint B.  (This technique also helps with reporting scope changes over time.)

__Bill

Like Alex Ball likes this
0 votes
Johnny Mon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 26, 2023

Hi @Alex Ball ,

I recently came up with a solution using A4J Data Center version 9.0.3 (on-prem) that covers the difficult 'removal' or 'changed' scenario.  Please check out my Github respository: a4j-notification-add-remove-issue-sprint 

for the exported rule and details on the implementation.

Alex Ball January 5, 2024

Thanks! We're using Cloud. For what it's worth, we're currently using a version of Bill Sheboy's revised suggestion, with an automation rule to copy the sprint value to an "Original Sprint" custom field, and checking against that when an issue's sprint value changes.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events