JIRA Agile REST-API: Can you query Sprints by name? - rest

I'm trying to get the number of an active sprint onto a dashboard using JIRA agile api but there are multiple active sprints on the board and I'm only interested in the sprint named #{SomeNumber}. (the # is what I'm looking for)
I tried to add a query parameter to my request -
jira.acme.com/rest/agile/1.0/board/42/sprint?name=#69 - but it seems to be ignored and JIRA will answer with all existing sprints on that board.
However, doing the same thing with boards works and I can properly query sprints by state.
Am I doing something wrong or is querying sprints like this just not intended?
edit: I should add, that the doesn't seem to be caused by the # as querying with words that occur in sprint names doesn't work either.

I don't know of a way to directly find a sprint by name or regex on the name.
However, if you have a board associated with some sprints, you can go that route. I'm doing something similar where I use sprints() to grab the active sprints from my board (since we only have 1 active sprint at a time this ends up working for me). If you wanted to go by name you could grab all the sprints from the board and iterate over them to match by name.
python eg.
from jira import JIRA
from jira.resources import GreenHopperResource
def find_active_sprint_by_name(the_sprint_name_im_looking_for):
jira_options = {
'server':your_jira_server_url,
'agile_rest_path':GreenHopperResource.AGILE_BASE_REST_PATH
}
jira_api = JIRA(jira_options, basic_auth=(jira_username, jira_password))
active_sprints = jira_api.sprints(board_id=your_board_id, state='active')
for sprint in active_sprints:
if sprint.name == the_sprint_name_im_looking_for
return sprint
return None

Related

Defining an Azure Board query that tracks work I have performed during current sprint - at any given time within that sprint

I am trying to come up with n Azure Board query to return the work I have performed during current sprint - which I am vaguely defining as:
Work In Current Sprint = [A] + [B]
where
A = work items where I completed development stage (or was decided at some point work is irrelevant) and
B = work items I created in current sprint, not necessarily assign to me nor my team (I spent time investigating an issue, and ended up, for instance, finding a bug, so I want this included in this "report").
The closest I could get is the query blow. Problem is it is still not quite accurate, since with regards to items I created during this sprint - I could not find a way to filter created items in this sprint only - results are showing up work items that CURRENTLY BELONG to current sprint, but not necessarily created in current sprint. The only way I see I can achieve what I want is using CreatedBy - but this only provides a "hardcoded" date range offset, at any given time. If I use an offset of 14 days backwards, running query at the last day of the sprint (considering a 2 week sprint duration) should work, but running the query at any day before that, during the sprint, will return stuff created in previous sprints.
I want this query to help me track "work I have performed during current sprint" (as defined above) at any given day within the sprint.
Any better ideas ?
You could use custom date in 'create date' to limit the work item.
And I notice you use 'work items and direct links', then you need set filters for 'Filters for linked work items' part(as you needed, like iteration path etc.). Otherwise it may return linked work item that belong to other iterations, according to the filled filter, like something belows:
I hope it could help.

Is there a way to filter an Azure DevOps board using dates?

On the Boards section of Azure DevOps, there's a nice filter bar. It contains filters for:
Type
Assigned to
Tags
Iteration
Area
Parent work item
As far as I can see, there's no way to use the section outlined in yellow to filter for work items (for example) created within the last seven days, or due within the next 14 days.
Things I've tried:
Creating a query and viewing results as a board (can't see an option to do that)
Finding a way to script work items into iterations based on date, and then filtering the board based on iteration
Is there a way to do this? It's specifically a board I'd like, as opposed to a Backlog-style list.
Just change the board's settings, Is this what you want?

Increment Planning Query

Our teams are using Azure DevOps. We're using the Agile framework and an enterprise release management approach (essentially, SAFe). Our increments are based on the quarters of the year -- for us, this equals 6 sprints.
My goal is to be able to view work scheduled within the current increment as the sprints move along.
I currently have a query that displays current sprint plus the future 5, to give me 3 month's worth of work (see below).
The trouble with this is it has to be edited after each sprint so it only displays the current increment's work. (I have to change it to include the previous sprint and reduce the number of future sprints otherwise it doesn't display completed work in this increment, as well as showing upcoming work from the next increment.)
Increment Planning Query
Sorry for any inconvenience.
I am afraid there is no such increment planning query, that because the value of CurrentIteration will be different due to the change of the current date.
If you want use the #CurrentIteration macros, you have to modify this query after each sprint.
As workaround, you could specify the each Iteration value in the query, like:
With this workaround, we do not need modify the query after each sprint, just need update it after each quarter.
If above workaround not work for you, you could add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions. Thank you for helping us build a better Azure DevOps:
Hope this helps.

How to create Azure DevOps wiki reports for sprints?

Sprint 146 in Azure DevOps introduced the possibility to embed queries in the Wiki. More info here: https://learn.microsoft.com/en-us/azure/devops/release-notes/2019/sprint-146-update#embed-azure-boards-query-results-in-wiki
In the image shown in the post:
It shows that you can, probably, create reports for each sprint. I have already some queries that are used to retrieve same data (for example active bugs), but are based on the current iteration like this:
Work Item Type = Bug
AND State Not In Done
AND Iteration Path Under #CurrentIteration
But I'd like to have a report I can see in the wiki for each of the sprint (both past and future ones) I have in the backlog, so how can I achieve that (if there's a way)?
I thought I could create and duplicate the same query replacing #CurrentIteration with the one that I'm interested in, but we're hundreds of sprints in the way, so I cannot create 100 copies of the same query just to replace a parameter.
Is there a simple way to do it? Am I missing something?

Synchronize custom column state between Area Paths in VSTS

I have a VSTS project based on the Scrum process with two Area Paths for frontend and backend teams. For all Backlog item boards I created a new column to indicate what is 'ready for testing' (splitted in doing and done). For the state mapping I could only chose 'Commited' from the dropdown list.
The root area is configured to include both sub-areas and should provide a broad overview for the product owner about the progress and the tester to see what he needs to do.
My problem is, that when a team moves an item to this column, the change of state is not reflected on the general board. How can I achieve this? Or what are best practices to deal with additional states like 'ready for deployment' and 'ready for test'?
Kanban board states are "per team" so you won't see the change reflected in another team's board (in this case, the top level default team).
If this was on-premise we could add a new underlying State to the Work Item so it worked across teams. I believe this is coming for VSTS but it's not there yet.
VSTS and TFS 2015 Update 1 allow you to Query by Kanban board changes which means you could have a Work Item Query which shows all the items across teams that are Ready For Test on the board.
Depending on exactly what you want to see in your query results, you'll probably have to do something slightly clever with grouping the clauses of your query - ie. (PBI Area Path = Area 1 AND Column State = Ready for test) OR (PBI Area Path = Area 2 AND Column State = Ready for test)