Hello,
My team has some tasks that are repetitive and don't need conventional sprint planing. I just need those tickets to be sent to the corresponding sprints.
It means a ticket would have a due date and the newly created ticket would just be automatically assigned to that sprint. Sprints for a whole year can be created, but tickets either come on later or their dates get changed. So the trigger is not the created sprint but the created ticket or the ticket with a date change.
How could I realize this?
Thank you very much!
As you are talking about 50+ sprints, I am assuming you have 1 week sprint.
You will have to write two rules as there are two triggers
one for Create Issue and one for field change (due date).
Create a smart variable say varSprintName and extract required values like this
Sprint{{issue.duedate.weekOfYear}}.{{issue.duedate.year}}
or whatever is your sprint naming convention
For due date of 27th March 2025, you will get Sprint13.2025
Then you can edit the issue for Sprint and assign it the value using varSprintName
See if this works for you.
this was my first idea as well. But the problem is, I can't set the Sprint as a string but I need to select a sprint with this name from the list.
If I do it the way you described, I get the error that my sprint Id needs to be a number. So what I technically need is someway that variable to be found in the sprint name and then chosen.
Do you think there is possibilty for this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now that the approach to get sprint name is correct,
next step will be
Refer this link and see if you are able to make progress
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you been able to make progress?
Once you have successful webresponse, you will need to use Advanced Branch to iterate over each sprint value returned using smart value {{webResponse.body.values}}.
Would like to see what rule you have written so far and I can fill the missing pieces.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vishal Biyani ,
No, I'm sadly still strugling with the web response.
{my jira link}/rest/agile/1.0/board/{Sprintid}/sprint
This is what I'm using with my Sprint ID and my Jira authentication token, but it's giving me Error 404 and can't find the page
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
send web request
use this end point
GET -> https://your-domain.atlassian.net/rest/agile/1.0/board/{boardid}/sprint
replace {boardid} with your board id.
This returns all sprints available.
Advanced Branching (Loop through sprints)
For each: Smart value
Variable: varSprintDetails
Smart value: {{webResponse.body.values}}
Condition: Compare Values
If: Compare two values
Check if
{{varSprintDetails.name}} equals {{varSprintName}}
Edit Issue Fields (Advanced)
Additional fields:
{
"fields": {
"sprint": {{varSprintDetails.id.asNumber}}
}
}
This will help you move forward. Let me know if any question.
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.
hey @Vishal Biyani ,
I meant Board ID as well on top, was my mistake. It still can't find the page. My atlassion domain is probably causing a problem but I don't know why...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To get the board id, go to your project and click on the board. the board id will come in the address bar.
Can you check
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have my board ID, something else doesnt work
I get HTTP Body not found, 404
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
404 is Returned if board does not exist or the user does not have permission to view it.
For this API https://your-domain.atlassian.net/rest/agile/1.0/board/{boardId}/sprint
can you make sure you are using basic authentication or passing the token in header?
Try using postman or bruno to debug the issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Vishal Biyani ,
I am using my token.
Authorization and then Bearer /my token/
Still not working...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I doubt if Bearer <token> works with web request.
First encode the username and token like shown in below code. You can use some online tool also if permitted by your security policy
import base64
import json
auth_token=f'{username}:{personal_access_token}'
encoded_token = base64.b64encode(auth_token.encode()).decode()
print(json.dumps({'Authorization': f'Basic {encoded_token}'})
Then in Headers, add
key = Authorization
value = Basic <value obtained after Basic from above code>
The "Send web request" call will work with this way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finally made progress! My webhook needed a jira component.
I have another problem know tho. When I say get all the sprints on board, I have a limitation of 50 Sprints and I need to filter just the active an future ones.
How can I do this?
Thank you so much in advanced!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in the API you can pass a query parameter state
Filters results to sprints in specified states. Valid values: future, active, closed. You can define multiple states separated by commas, e.g. state=active,future
see if this helps reduce number of sprints returned
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Vishal Biyani thank you.
Now I'm stuck on the last part. I don't have the for each function on the branch. This seems like a deal breaker for the whole automation. It seems like I'd have to it for every sprint by hand. Or am I seeing this wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you click on add a branch, you will see screen like below. Click on Advanced branching and here you can branch on the array of sprints.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vishal Biyani I don't have this. I don't have Jira cloud and don't see those options. My Jira is very limited I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oh.. your tags mentioned jira-cloud.
If you are on server version, then it does have limitations.
Probably tweaking the logic to fit the limitations will be required.
Can you share your automation rule that you have so far?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh yeah, those tags came automatically I think. cause I def didn't add them :)
Will share the automation as basic as possible asap :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok, so below you can find my steps:
1. Created a trigger for certain tickets (summary is filtered) and checked for a not empty due date.
2. Created a variable to get the duedate from each ticket.
3. Added a send web request and used my personal jira credentials to get the information.
4. Created another variable to convert the date because it has a dd.mm.yyyy format and apparently jira needs it other way around. (what I got from the internet:))
5. Created another variable to get the responses of the web request: {{webReponse.body.values}} --> I'm also having issues here, because when I log this I don't get anything. So that's another issue but my main problem comes next
6. At this stage I need to create a branch so it goes through all the sprints that are found in the web response, but I can't do it becase I'm not on cloud.
So this is where I'm at :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you be able to help here?
I don't have any experience using Automation with Jira server. Due to lack of clarity the solution was geared towards cloud when it should have factored in Jira server.
Thanks,
Vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as I understand, you want to automatically assign tickets to the correct sprint based on their due date.
You can use Jira Automation to achieve this. afaik, Automation doesn't let you dynamically search which sprint contains a date but you can use if-else conditions for each sprint as a workaround.
use trigger as the field value changed: Due date (or issue created)
In the action you will have if-else blocks to check the due date range and assign the matching sprint
(action -> Edit Issues -> Field: Sprint -> Value: Sprint 5)
IF Due Date is after 2025-04-01 AND before 2025-04-14 then Assign to Sprint “Sprint 4”
IF Due Date is after 2025-04-15 AND before 2025-04-28 then Assign to Sprint “Sprint 5”
I hope that helps
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 suggestion. But the problem is I'd like to do this for a whole year and then I'd have to have roundabout 50 iterations. This might be a big performance problem for the automation. And I would have to do it every year new.
What I was thinking is, I have a dute date in my ticket and I can take the ww.yy from my ticket and the sprint names contain this format as well. So I feel like this should be possible but I don't know how :)
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.