Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Ticket assignment to defined sprints

goekce_vardar1 March 24, 2025

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!

2 answers

2 votes
Vishal Biyani
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.
March 24, 2025

@goekce_vardar1 

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.

 

goekce_vardar1 March 24, 2025

Hi @Vishal Biyani

 

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?

Vishal Biyani
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.
March 24, 2025

Now that the approach to get sprint name is correct,

next step will be

  • send a web request to get all the sprints
  • using smart filter get the id
  • edit the issue

Refer this link and see if you are able to make progress

https://community.atlassian.com/forums/Jira-questions/Re-How-to-change-sprint-in-JIRA-automation-based-on-name/qaq-p/2654509/comment-id/935659#M935659

 

 

Vishal Biyani
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.
March 24, 2025

@goekce_vardar1 

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.

 

goekce_vardar1 March 25, 2025

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

Vishal Biyani
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.
March 25, 2025

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.

goekce_vardar1 March 27, 2025

Hi @Vishal Biyani ,

I will try this asap and let you know! 

goekce_vardar1 March 27, 2025

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... 

Vishal Biyani
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.
March 27, 2025

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

goekce_vardar1 March 27, 2025

I have my board ID, something else doesnt work

I get HTTP Body not found, 404

Vishal Biyani
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.
March 27, 2025

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

goekce_vardar1 March 31, 2025

Hey @Vishal Biyani ,

I am using my token.

Authorization and then Bearer /my token/

Still not working...

Vishal Biyani
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.
March 31, 2025

@goekce_vardar1 

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

goekce_vardar1 April 15, 2025

Hi @Vishal Biyani

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! 

Vishal Biyani
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.
April 15, 2025

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

goekce_vardar1 April 15, 2025

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?

Vishal Biyani
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.
April 16, 2025

@goekce_vardar1 

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.

snip.png

goekce_vardar1 April 22, 2025

@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.

Vishal Biyani
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.
April 22, 2025

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? 

goekce_vardar1 April 22, 2025

Oh yeah, those tags came automatically I think. cause I def didn't add them :)

Will share the automation as basic as possible asap :)

goekce_vardar1 April 22, 2025

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 :)

Vishal Biyani
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.
April 22, 2025

@Bill Sheboy 

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

0 votes
Tuncay Senturk
Community Champion
March 24, 2025

Hi @goekce_vardar1 

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

goekce_vardar1 March 24, 2025

Hi @Tuncay Senturk

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 :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events