Hi guys,
I'm trying to do small but important thing for my team.
ENV:
Jira Cloud
Project - Company managed
Script runner
Problem to solve:
I need to block the possibility of creating a new issue with an assigned sprint if the sum of story points in the sprint exceeds X. Both sprint and story points are required for every issue.
I tried to achieve this using a workflow validator with Script Runner, but unfortunately, Script Runner in this case only allows me to use "Script Validators ONLY use Jira Expressions"
Is there any solution to achieve this?
edit.
I've implemented some similar using automation, but it only triggers after the issue has been created and it's too late.
Hi @Tir Neo , Welcome to the Atlassian Community.
The answer to your question is quite simple and does not concern Jira. The team is in charge on how many story points they can manage in a sprint. It is the only way in which they can fully commit to getting the sprint done in its entirety.
Only by letting them do the full scrum circle of
they can evolve into a better, more agile version of themselves and have focus on quality and efficiency.
Sprint planning is about which issues from the top of the backlog are we (as a team) comfortable with to fit into the coming sprint. When can we fully agree upon the fact that we're confident and committed to finishing the tasks we put into the next sprint.
Daily Scrum is about signaling potential setbacks and solve these in the safe environment of the team.
Sprint review is about letting the client / customer / stakeholder know the new stuff that's been developed in the last sprint. It provides the client to give feedback and even allows them to re-prioritize the order in which parts should be handled, and/or the direction into which the next sprint should focus. This gives the team the opportunity to (switch to (=agile!)) work on the stuff that's contributing the most to the clients needs.
Sprint retrospective is about the team learning and evaluating the last sprint, in order to increase quality and effectiveness of the incremental value they deliver to the client. Scope changes by tickets created and put in the sprint should be discussed thoroughly here, especially if they are the cause that a sprint goal isn't reached at the end of a sprint.
You can do many things in Jira to limit the creation of the mentioned ticket, but you cannot have this as an alternative to guarantee sprint completion. Furthermore, it would take away possible lessons learned by the team and would not contribute to team growth and welfare.
Kind regards,
Dick
Whatever purpose you strive for, unwanted creation of tickets (of all types) in a sprint can be easily mitigated by putting restrictions on who can transition issues, found in the permission scheme of the project at hand, or specifically set in the project's workflow from status "open" into another workflow status.
There is no need for scripting if you enable this for a person that cares for team sanity.
Kind regards,
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tir Neo -- Welcome to the Atlassian Community!
Adding to the ideas from @Dick ...
What problem are you trying to solve? That is, "why do this?" Knowing that may help the community to offer other alternatives, and for your team to discuss root causes and decide how to improve.
Until we know that problem being solved...
Attempting to automate the blocking of issue creation (or even assignment of issues to a sprint) may lead to unintended consequences...making the situation much worse. Those could include:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy , thank you for putting these additional gems forward. I hope our mutual tips with their explained rationale can trump the use of scripts that will in fact hinder team growth and agile transparency.
Kind regards,
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Tir Neo
Welcome to the Community!
You can use a Jira Expression in a Script Validator with ScriptRunner. While this approach has some limitations, it can solve your problem. Here's how you can implement it:
Jira Expression for Sprint Story Point Validation
You can use the following Jira Expression in a Script Validator:
let sprintId = issue.sprint ? issue.sprint.id : null;
let storyPoints = issue.storyPoints ? issue.storyPoints : 0;
let maxPoints = 100; // Set your desired maximum story points here
if (sprintId) {
let sprintIssues = issues.filter(i => i.sprint && i.sprint.id == sprintId);
let totalPoints = sprintIssues.map(i => i.storyPoints ? i.storyPoints : 0).reduce((sum, points) => sum + points, 0);
if (totalPoints + storyPoints > maxPoints) {
return false;
}
}
return true;
This expression does the following:
maxPoints
as needed).false
if the limit is exceeded, blocking the issue creation.Implementation Steps
Let me know how it goes!
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately it doesn't work, i got the error
"Jira expression failed to parse: line 12, column 1: else expected, } encountered."
After some fiexes I got same error as when i'm trying to do it myself - "Evaluation failed: "issues" - identifier not available in context"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Taking it from sprint it's not a must have, it's also can be epic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's.... dare I say it... even worse.
Epics normally span multiple sprints. Plopping one of those into a sprint would have an enormous impact on team morale and sense of being in control of the sprint content.
A good read on the agile manifesto might steer you into the right direction here:
https://www.scrum.org/resources
Kind regards,
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.