Automation Rules for Sprints
Asked by Elena Papa:

This might be a little complicated, but I would like to know if it is possible to do.

For our Claim Ticket System I have created a SCRUM board that has several Sprints to identify the different ticket statuses ( if they are change requests, defects, config changes, etc).

I have 1 Active Sprint ONLY at the moment for this Release which only contains the tickets that need to be worked on during this Release period. (have not included in this pic)

By default, (assuming from the filter im pulling these tickets from) every new ticket goes straight to "Backlog" so I just manually re-locate those different ticket types to the respective inactive sprints, for example:

When there is a config change ticket on "Backlog" I manually drag it to the "Backlog;Config Changes" Sprint.

I am wondering if there is an automation rule I can use to have those tickets manually re-locate themselves based on the issue type tickets they are.

![Screenshot 2024-08-06 170359.png](/t5/image/serverpage/image-id/340358i103BA75574FB0874/image-size/large?v=v2&px=999 "Screenshot 2024-08-06 170359.png")


Answers:
author: Bill Sheboy
body: Hi [@Elena Papa](/t5/user/viewprofilepage/user-id/5553797)

Yes, that is possible. The rule could be triggered on Issue Created, and use either a lookup table or if / else conditions to add the issues to the respective sprint by the sprint id values.

And...I wonder if instead of putting these issues in "sprints" to arrange them in the backlog, you could use Quick Filters on the issue type to see just the ones you want. What problem are you solving by having those extra sprints in the backlog? I am guessing those are never started as actual sprints for delivery, correct?

Kind regards,  
Bill

comments: author: Elena Papa
body: Correct, they will remain inactive, the only sprints that will be active are the different Release sprints which have the tickets that will be worked on, respectively.

"What problem are you solving by having those extra sprints in the backlog?"- My PM had this vision for this board so I basically just made it happen, I was also going to use a filter originally, but I guess this just makes it more easily accessible, If I had to take a guess.

I am unable to obtain Sprint ID values because it is only showing me the ID for the active sprints which I don't need. I would need the ID for the inactive Backlog Sprints in order to add them to the rule.


author: Bill Sheboy
body: To enter the sprint id values in the Edit Issue action you may:

* type in a smart value expression in the Sprint field
* it will appear below the field
* when it appears, select it to use for the edit

To find the sprint id values you need, you can see them when creating a query. For example, using Filters \> View All Issues

project = *yourProjectName* AND sprint = "Backlog: Defects

As you type in the sprint name, the id number will appear next to it in the recommended values. Note that for later use.

Putting that all together, an example rule could be this, assuming the issue types are the deciding field:

* trigger: issue created
* action: re-fetch issue
* action: create a lookup table for mapping your types to the sprint ids
  * name: varTypeToSprintId
  * row
    * key: change request
    * value: 123
  * row
    * key: config change
    * value: 456
  * row
    * key: defect
    * value: 789
* smart values condition: check if the lookup would return a value
  * first value: {{varTypeToSprintId.get(issue.issuetype.name.lowercase())}}
  * condition: does not equal
  * second value: *leave this empty*
* action: edit issue
  * set the sprint field to
    * {{varTypeToSprintId.get(issue.issuetype.name.lowercase()).asNumber}}


Tags: atlassian

backlog

cloud

jira-cloud

scrum

scrum-board

sprint

sprints