Using JIRA Rest API to get a list of all users on a board instead of project? - rest

Is there a way to do this, or is it even possible to view all users (members of a JIRA board) on the actual application? My workaround for this right now is to query for all issues grab the creators and assignees throw them into a list if they're not already in it. I'd like a more efficient way of doing this, but also this workaround isn't going to work for what I need. Our project has multiple boards, there's one board I'm concerned with and it consists of 10 or so members, the project itself has about 50 members. I know I could query and filter results based on a list, but I'm working on making this applicable across all teams. So is there a way to get a list of users on a board instead of project?

JIRA Software provides a REST API resource to retrieve all issues of a board: GET /rest/agile/1.0/board/{boardId}/issue
Once you have that list you still have to run over all the issues and retrieve the details of each issue, e.g. by using GET /rest/api/2/issue/{issueIdOrKey}. That way you can collect the users that you need.
This still requires some scripting, but should be easy to make this generic so you can support any board.

Related

Azure Devops API - how to filter/search by project name?

I'm using the GET project List API and I want to filter out the results by a search query parameters.
I have multiple projects under a certain organization and I want to get back only the projects that start with some 'name' initial. I looked everywhere on the documentation but couldn't find any way doing such a query. Is there a way to narrow down the results?
I saw that some API's have the ?$filter={filter} query param, but it won't work on projects filtering.
As you said, it's impossible in this API to filter the results before you get them.
You only can filter the projects after you get the reulsts with Bash/Powershell etc.
I run into similar issue, except I am trying to filter base on Azure Devops's Repo list.
It seems M$ has done a terrible job in providing consistent filters features.
I did notice some of the API does provide ?$filter={filter} and I found documentation here would probably help?
Some of the API provides a different search method in form of search criteria /commits?searchCriteria.$skip={searchCriteria.$skip}&searchCriteria.$top={searchCriteria.$top}...
https://learn.microsoft.com/en-us/rest/api/azure/devops/git/commits/get-commits?view=azure-devops-rest-6.0

How to make an Azure DevOps Query which returns only on side of link?

We are working on implementing an architecture review which affects a specific subset of work items. I created the following query:
The result includes the downstream work items, which is what I want. However, it also includes the work items marked as with the Architect Decision, which I don't want. My ultimate goal is to see on a dashboard how many work items are blocked by architect decisions which are pending.
AzDO does not support that. If you want to see a plain list, you should use a flat query. As workaround, you may write your own job through REST API (as example):
Find epics, features, stories, and bugs without the Blocked by Architect Decision tag and with open work items contain the Architect Decision. Add to these work items the Blocked by Architect Decision tag.
Find epics, features, stories, and bugs with the Blocked by Architect Decision tag and without open work items contain the Architect Decision. Remove from these work items the Blocked by Architect Decision tag.
Then you can search your blocked work items with a flat query and the Blocked by Architect Decision tag.
The Rest Api methods:
Query By Wiql.
Update a work item tag.
Additionally, you`ll receive a notification when your work items are unblocked.

Is it possible to move project collection between two organizations?

We are currently having a project collection with backlogs, sprints, etc. in an Azure DevOps account. There is another organization with completely different credentials to log in that we'd like to transfer this project collection to the other organization. I could not find any features or approaches to complete this transfer. Is there a way to be able to achieve this goal?
There is no way to migrate a project between organisations. This may become possible in the future, but the feature suggestion is 8 years old and hasn't seen progress, yet.
However, depending on your requirements, you might be able to create your own tools/scripts to "re-create" your project in the new organisation using the REST API.

VSTS Iterate over all WorkItems in an Epic

I am building a VSTS dashboard widget where I would like to iterate over all Features in a particular Epic, and then for each Feature gather data about all the WorkItems to create a status report.
I know I can use getWorkItem() and getWorkItems(), but that is if I already know the WorkItem IDs. I want to loop through all the features and then all the WorkItems and see if they are completed, without knowing their particular ids.
The VSTS work item tracking system is very extensible, therefore there aren't any "fixed" methods that will return you specific work item types. Even though features in VSTS rely on one or more levels of work items being present, their name, the fields and other aspects of these work items are highly configurable.
To query the available work item levels (called Categories in VSTS), you can use the Categories/List API. This will allow you to find hierarchy as it's configured in VSTS and which work item types are available at each level.
You can use the ProcessConfiguration/Get API to list the relationship between the different backlog levels. Which is a parent of which and what type of backlog it represents. Is it a Task (lowest level), Requirement (Story, PBI level, planning level), or a Portfolio (Epic, Feature etc) level backlog.
With this information, you can either use the Backlig/GetBacklogWorkItems API to fetch all the work items on a specific backlog or you can construct a WIQL (Work Item Query Language) query to retrieve all work items that match that specific query. You can either export the WIQL from Visual Studio or use an extension.
Depending on what you need with each work item you can either query directly for the required fields, or just query the work item ID's and fetch the work item details individually using the workitem/getWorkItems(id) API.
There is pretty extensive documentation available on each of these API's and on the required VSTS services you can use from your extension. going deep to explain each of the services goes too far for this answer. I suggest you start experimenting from here and ask new questions as they arise. You now have far more information to work with and it will be easier to ask targetted questions from there.

Using the TFS REST API to get all work items in an iteration

I am attempting to get some information about all User Stories in the current sprint. I can get the path to the current sprint easily, and given a list of the IDs for the work items I can get what I need from them, but I am unsure of how to get those IDs from just the iteration path.
I have seen an example of this using C# and queries, but I am using javascript and the REST API, and I would prefer not to user queries if possible.
The best way to achieve this is using queries which designed to help you find work items that you want to review, triage, update, or list in a report.
The Work Item Query Language is also supported with REST API. There is a Parameter [System.IterationPath] which meets your requirement.
More detail info please refer:
Programmatically query for work items
• REST APIs: Work item queries and query folders and Work item
query language
The only generic solution I could find was to get all work items ids by iterating all pages from Read Reporting Revisions
Then get bulks of work items from List Work Items
Unfortunately TFS/AzureDevops do not offer a shorter path without using queries.