Hi.
I'm looking to add some automation in for some of my sprint boards. In short I want Jira to remove any issues that do not meet the Definition of Ready (have SP and an assignee added, and have the DOR checklist completed) when a sprint is started. Ideally I would also then trigger a message via web hook to the Slack channel.
So far I've managed to do this (see screenshot below), but struggling to work out how I can add an action which removes the issue from the sprint. Any ideas?
Hi @Prabh -- Welcome to the Atlassian Community!
I wonder if the team is mitigating a symptom and perhaps missing the root cause of this problem...
From what you describe, your team is dealing with starting sprints with items that are not ready to be worked on yet based upon your definition of ready. Asking "why" that is happening, may lead to discussion of...
Automatically removing things from the started sprint could lead to unintended consequences. As an alternative, what do you think of this: create a quick filter to identify issues you consider not ready, and *always* check it during sprint planning and before starting the sprint?
Best regards,
Bill
To remove an Issue from a Sprint, you simply remove that particular Sprint from the Sprint field in the issue.
Unfortunately, the easy approach to this in Automation doesn't seem to allow you to remove just one Sprint from the Sprint field. The only option in the "Edit Issue" action is to clear the field.
This has the unfortunate side-effect of removing any past Sprints listed there. That might affect reporting and some metrics. But if that's ok, it's the easiest way.
- - - - - - -
If you have to maintain any past Sprints in the Sprint field, then you'll need to be much, much trickier with your Automation rule. It's still an "Edit Issue" action, but you have to get into the "More options" area and use JSON.
NOTE: This will be difficult if you've not done much scripting, JSON, and/or software development.
I'll point you to the parts of the documentation for Automation that will help you solve this...
Here's a starting point for learning about how to use JSON for advanced issue editing in Automation:
https://confluence.atlassian.com/jirasoftwarecloud/advanced-field-editing-json-993927646.html
For reference, the JSON to clear the Sprint field (which can be done more easily as I described above) would look like this:
{ "fields": { "Sprint": null } }
But to maintain any older Sprints in that Sprint field, you'll need to instead remove the current Sprint from that field (instead of just clearing that field), so that the older Sprints remain.
Since you're using a Sprint-based trigger, you will have access to the newly started sprint:
You won't strictly use a Smart Value in the JSON though (you can access them more directly). But the above gives you guidance about the naming.
The approach would be to iterate over the current values in the Sprint field (if any), and keep only the values that do not match the current sprint. Iterating over values in a field is described here (near the end):
https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/
Conditional logic will be needed to identify the current Sprint and remove it:
https://support.atlassian.com/jira-software-cloud/docs/smart-values-conditional-logic/
Here's another reference to some code that is trying to solve a slightly different problem, but will give you a sense for the syntax and rationale. Scroll down to @Bill Sheboy's response on 23-Nov-2020:
One tip when doing advanced Automation rules is to take it in steps, and use the Audit Log action liberally to see what's going on.
If you do get a rule like this working, sharing the JSON back here with the Community would be super helpful. Best wishes!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.