We have a situation with out system development-department where we want all cases in the backlog to be shown on the "Board" in status Todo. We will have multiple sprints active at the same time depending on how the feature will be developed. To show a newly created case on the board it has to be added to a sprint. We have therfor created a sprint we want to add all the new cases to(to work like a backlog but show up on the Board). There will be too many new cases to do this job manully, and we therfor want to use atomation for this. The trigger will be "issue created", and we wwant the result to ba that the issue is added to the named sprint. Since we will have multiple active sprint simultaneously so it is not possible to use the action "edit issue" and the "Sprint" filed on the issue, since here we only have the possibility to choose the active or the next sprint(since we have multiple sprint active and will create new sprint later). I therefore think the solution will be to find the Smart value where the sprint data is stored, and updated this, but i find it hard to find the correct field and how to update it with the JSON. I have tried to find the value fith the sprint-data using the REST APIs, but it seems like the keys and fields in the API is different regards to the sprint-info on different issues, even though both issuestypes have the sprint fiield. Can someone assiste me in how i should do this in Jira Cloud?
Hello @Thomas Johannessen
Welcome to the Atlassian community.
Take a look at the answer from @Alex Koxaras -Relational- on this post.
Hi, thank you so much @Trudy Claspill . It seems like he wants to do the same i want, but unfortuntly it seems like it does not work for me. I get the id of the sprint i want to assigne it to(39), but when i do the last part in the action, i get "Additional fields contains invalid field(s) in 'update' or 'fields' section: Sprint"
If i use the REST API on the issue, i dont see the "Sprint" as a vlaue there, so this makes sense i think. But i see that i have the info about the sprint the issue is assigned to in this field:
48 is the ID of the sprint its assigned to now. Im not sure if this is just info of if changing this has any impact on which sprint its in. But when i try to change this i get an error:
I try to change it like this:
(Have tried with one less } at the end also)
Do you have any idea what i do wrong?
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.
Let's stick to this thread as that is where the rule image is posted.
After the change to remove the extra bracket please post new images of your rule and the audit log details showing the rule execution. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, thank you.
Here are them after removing one bracket. Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have experienced the same error ("must be a number") trying to set the Sprint field on an issue with this JSON code, though this matches the information in the post I found with Alex's answer.
{
"fields": {
"sprint": { "id": 58 }
}
}
I have also tried
{
"fields": {
"sprint": { "id": "58" }
}
}
And I've tried creating a variable, setting the variable's value to 58, and then using the variable in the JSON.
{
"fields": {
"sprint": { "id": {{SprintIdVariable.asNumber}} }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, did these work for you?
When i try i gte the error that Sprint-field do not exist. Any idea what is the reason behind this?
Any more suggestions on what i can try?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my rule regardless of whether I used "Sprint" or "sprint" in the JSON I got this error:
Number value expected as the Sprint id., The Sprint (id) must be a number (customfield_10020)
If you getting the "invalid field(s)" message that suggests that the Sprint field is not included on the Edit screen that is used for the issue type you are trying to edit in your rule.
Can you edit the Sprint field directly through the UI for that type of issue in the target project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Okey i see that i dont have the sprint field in the fields when i call the REST-API on the issue eigther. I can edit the sprint in these field, and choose any of the other fields.
Only thing i have on the issue in the rest api that is connected to the sprint is the customfield_10021.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The sprint field is on the issue type, and as you can se above it is filled out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, i see that i the XML i can see the name of the customfields , and the customfield_10021 is the Sprint.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I figured out how to solve the "must be a number" error.
The JSON code should be this:
{
"fields": {
"sprint": 58
}
}
I see from your image that you are working on an Automation rule for a Team Managed project. I tried the above in a Team Managed project using both sprint and customfield_##### and in both cases it worked.
(I'm not sure where I got the code that used {"id": number} . I think maybe I pulled that inadvertently from another document since I see in Alex's answer it was just "sprint": number )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, thank you so much for the help! You have been so helpfull! This almost worked for me... When i use the "sprint" field it failed:
But when i changed the name to the custom field IT WORKED!!
If works now, and im so greatfull! Thank you so much for your help and that you took your time to help me!
For anyone else having this issue:
Use https://XX.atlassian.net/rest/api/2/issue/XXX-XX (XX is the jira area and XXX-XX is the issue id)
Here you have all the info you need about the issue. Search for the sprint name or the sprint id.
Find the sprint id you want toassign it to, and use this as in my example above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Thomas Johannessen -- Welcome to the Atlassian Community!
First thing: I suggest you sit down with your Jira site admin to ask for help. Your scenario seems complicated and it will help to directly discuss this with the admin.
What you seem to be asking is...
Regarding #3 and #4, I recommend discussing this with your team's Scrum Master or Agile Coach. Adding issues to an in-progress sprint should be an exception, and not such a common practice that a team needs an automation rule to do so.
Let's assume your Scrum Master/Agile Coach still agrees with this approach...then #4 is key, as you would need to call the REST API to search all the sprints to find the one to use. Then add the issue to that sprint using the sprintId value.
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, we are a small department who handles this, so we do not have anyone with this advanced knowlegde unfortantly. I know this is not best way to use Jira, but this is how the department whants it. We will have multiple simuntainisly sprints(one for each supplier which does the fixing and developing for us, which some will be many short, and other few long once). The department wants to show everything that is in the backlog on the standard "Board" in a todo status. To be able to show new issues on the bord we have created a sprint until year 9999 which will do the exact same thing as the backlog(we will move them with this automation out of backlog the moment they are created, and therfore never have anything in the backlog and use this sprint as the backlog insted.) If you see my answer to Trudy it may be a bit clearer what i want and how i want to do it. Thank you so much for your sugestions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, and as both Trudy and I noted you will need to use the REST API to gather the sprints and then search for the value needed.
Regarding the error you see with the JSON, the number of left/right curly brackets must be balanced, and you appear to have one too many.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, if i dont have missunderstood your answer i think i describes the problem better in Trudys answer. I have tried with one fewer curly brases but same error. Do you know what can be the error or next step to try? Do my syntax looks correct except the last curly brase?
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.