Hey Everyone,
I am working on a Jira Cloud instance, and I would like to be able to assign a Sprint to a created Epic automatically. This would be done by comparing the Due Date of the created Epic with the dates of active and future sprints. The correct Sprint will be chosen if the Due Date of the Epic is between the Start Date and End Date of the Sprint.
The Epic, when created, already has a Due Date. I want to avoid manually editing the Sprint field to fit the Due Date.
I have tried using both Jira Automation and JMWE to automate this but to no avail. I am unsure if there is a way to do this with these apps ?
Thank you for your help,
Hi @Guillaume Govers -- Welcome to the Atlassian Community!
First thing, what problem are you trying to solve by doing this?
I wonder because epics are typically not assigned to sprints as they are larger work items, taking multiple sprints to complete, and so their child issues are assigned to sprints.
Regarding your use case and question, this might be possible, by either...
Kind regards,
Bill
Hey @Bill Sheboy
I appreciate that the way we use Epics is not the typical one. We are a non-dev team and an Epic is equal to an analysis that should be produced during a Sprint. This Epic has associated tasks (and not stories as seems to be the norm) that divide the work up. In the majority of the cases the Epic and related tasks will all be done in one sprint.
We have an integrated system where an external app automatically creates Epics with a populated Due Date. The idea is that instead of manually assigning these Epics to our Sprints this would be done automatically.
1. Not sure I understand your suggestion. Would Sprint names look something like this?
"Sprint XXX: ##Start Date##;##End Date##" Sprint 34:22/08/22;10/09/22
Would I then use the Smart Values in Jira Automation to deduce the dates of a Spriint from its title ?
2. I have never used the REST API but have been wondering if this would be required here. Would you happen to have an example of a similar API that I could base myself on?
Thanks for your help,
Guillaume
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For method #1: yes, I was suggesting a structured sprint name that could be created only using the date (and not necessarily the number). Let's say you pick an anchor starting date of 1 Jan 2022, and have 2 week sprints. You should be able to determine the correct sprint based upon the due date by rounding up to the next whole 2 week increment.
For the REST API usage (for #1 or #2), here is a great how-to article showing how to call such methods:
And the specific method you want is to get all the sprints for a board:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, again @Bill Sheboy
I have managed to configure two web requests with the Rest API.
The first one is a GET that returns all the sprints of my board, as you suggested.
The second one is a PUT that edits the sprint field of my trigger issue.
These two seem to work fine after some back and forth.
However, I still can't seem to find a way to differentiate sprints depending on the due date of the trigger issue. I have tried using the Jira Automation conditions to no avail. I have also tried using the Due Date smart value in the JSON of the web request, but they do not seem compatible.
To my understanding, with the smart values, I should be able to access the start date of all sprints from my first web request and compare them to the due date. Or could I add an "if" function in the payload of my web request? It is still unclear to me how to achieve this distinction based on the due date.
Thank you for your help already, feeling quite proud to have used the REST API for the first time :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe you can do this with smart value list filtering: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
For your web request response to gather all of the sprints, use the issue's due date and find the one where the due date is within the sprint's data range. Then use that sprint name (or id) as needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bill Sheboy
Have been dabbling in this, however every time I seem to have a smart value filter that should work I seem to get this error message:
"Error invoking method com.codebarrel.automation.api.component.smartvalues.objectwrappers.CollectionWrapper.Element.get(java.lang.String@2061000330) on com.codebarrel.automation.api.component.smartvalues.objectwrappers.CollectionWrapper.Element@1007599544:"
I am not sure how to solve it. I have found some similar errors that seem related to the use of plug-ins. This does not seem to apply here as I am using only classic Jira fields ?
I would appreciate any insight you have here. Thank you for your help,
Guillaume
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps the structure of the response does not match what you expect. Please first try running that REST API request by just pasting the URL into a browser. Then review the resulting response message to confirm you are getting the correct smart value layout.
UPDATE: After I experimented with this, I do not believe this can work with smart value, list filtering. Sorry for the bad solution idea.
First, the endDate value from the response needs to be converted from Text to a Date type for comparisons, leading to an expression like this:
{{#webResponse.body.values}}{{#if(endDate.toDate.isAfter(issue.duedate))}}{{name}}:{{endDate}}{{/}}{{/}}
Unfortunately...issue fields (and created variables) cannot be used inside of a function, which is inside of an iterator. Atlassian has already marked this defect as "Won't fix": https://codebarrel.atlassian.net/browse/AUT-2430
I also tried other functions instead of isAfter() and they were of no help. The problem seems again related to trying to do this in the filter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think it is possible at the moment either @Bill Sheboy. I couldn't think of a way to do it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answers. I went with a simpler solution that requires the date of the next sprints to be added manually to the automation rule every few months. This won't be completely automatic but should work well enough for my use-case.
Thank you so much for your help and guidance,
Guillaume
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What would be the event that would trigger the association between the epic and the sprint?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.