WIQL or query to get all related work-item, but NOT listing the parents - azure-devops

I have a query listing all features and their child/related work-items.
Is there a way not to display the features (parents) itself? Just a flat list of all work-items having a link with a feature in this project.

I am afraid you cannot use the flat list of work items to query the work items with links.
You can have a try using a Work items and direct links type of query to show the children work items of the Features on the top level. See below:
If you want to add a query result account widget on dashboards, you can check out the Query Tile PRO tool.

Related

Azure DevOps reorder work items in query result

Is there a way I can reorder work items from a query results as I would normally do with backlog work items?
I'm using the order of work items in the backlog to set the order of issues to address, I would like to use queries to view work items by certain criteria (cross-project) so the backlog board is not a good choice for me.
thank
The description is little confusing, but if you just want to order your query result(according to the title of this thread) by specific condition, the wiql would be very helpful.
Add the Wiql Editor extension to your organization, then create a query with the other conditions you need, click the "Edit query wiql" and update the query wiql.
For information about wiql syntax, please check Syntax for the Work Item Query Language (WIQL), the order by would be the one you are looking for.

Azure DevOps Boards - display query result on a board

how to develop the extension to display query result on a board? Such thing is not possible in the Azure Devops unfortunatelly. I've found two extensions on the marketplace which are doing what I need:
AA Query Board
Query based boards
but this extensions are not updated for a long time and I couldn't contact the authors (I need to change few things in order to be able to use it internally in my company).
I've found also this topic Add tabs on query result pages, so it looks like it's quite easy to add new tab to the query result menu, but I have no idea and I can't find any info how to get data (work items) from query result to display them?
Rest of the extension is just to display this data in grid, so that would be also quite easy, but getting this query result data is blocking me.
There is a Query Results Widget that you can use to display the query results on the Dashboards under Overview.
1, First you need to create a shared query if not exist, and save query to the shared queries folder shown as below screenshot. (You can click the Column options from the Editor page to add and remove columns to be shown on the results)
Or drag and drop the query from My Queries folder to Shared Queries folder.
2, Go to Dashboards under Overview, and Click Edit, then search and add widget Query results
3, Click the gear icon on the Query Results widget to configure it and select the query you want to display. Then the query result will be display on the Dashboards
Update:
There are some other ways to show the query results on the dashboards, For below example:
you can select your shared query and click more actions(3dots) and click Add to dashboards. This will display simple total number of query results.
you can also create different Charts for the query results and add it to Dashboards.
Select your shared query and go to Charts tab, the choose New Chart, select a Chart type, After you configured the chart, you can click the 3dots on the chart and add it to dashboards, check below screenshot:
Eventually I managed to contact the author of the "AA Query Board" extension and it turns out that he has a public repository on GitHub with the source code of the extension, so basically everyone can lookup how it's done or base on it.
Link to the repository: https://github.com/staticnz/aa_query_board

Can I see the backlog as a treeview when filtering out done items on Azure Boards?

I'm using the basic work item process in Azure DevOps.
If I look at my backlog without any filters, then it shows me a hierarchy, with epics as the top-level items, then issues and then work items.
If I filter this to only show items that are to do or doing, it shows them as a flat list, not a hierarchy.
Is there any way to see the items as a hierarchy, but filter out done items?
Update following Shayki Abramczyk's comment
The options button doesn't include an option to show parents...
Go to the Work Item Query tab and create a work item query. Configure it to Tree view and let it follow the parent/child relation.
You can filter on the top level (top part of the query editor) and the lower levels (bottom part of the query editor). Use the State in filter to select multiple states. You can't multi-select them in the UI, so typing is required:
PS: The , is the list separator in most languages, but sometimes you need to use ;.
If you want to see parents when ANY child leaf is still open, set the Filter: Match top-level items first to Filter: Match child-level items first.
To specify the order, add the Backlog Priority field to the query and use the table header to sort by it:
Or use the Sorting option in the "Choose Columns" fly-out:
Note: The exact field name differs per Process template. Backlog Priority is for the Scrum Template, Stackrank for CMMI and Agile and Basic:
An easy way to get started is to take the board view closest to what you want and save it as a work item query.

Report Of Work Items & Their Parents

Hey Folks my org recently migrated from TFS 2017 to VSTS online. Our IT Finance team has a report that show work items along with their parents and your grandparents. It was built around a SQL query that looked at the backend SQL database. Is there a way to create a report of all work items and their parents in VSTS online?
Yes, it’s possible to show all the work items as parent/child relation in VSTS. Detail steps as below:
Create a new query with Tree of work items type.
Add the filter Work Item Type = [Any] both for top level work items and linked work items. And select Parent/Child Type of tree, then save the query.
Run the query and you will get all the work items with tree view relations.

Query items user was mentioned in

Is there a way to query work items where a user was mentioned? I am able to receive 'hard-coded' results by querying for
"History"-"Contains word"-"\#Username",
but I want a generic version, which works for all users. (Opposed to writing one query for every user)
Use this predicate:
Field: "ID"
Operator: "In"
Value: "#RecentMentions"
This automatically filters for work items, where current user has been mentioned.
I found it in predefined filter "Mentioned" in "Work Items" section. If you click on "Open in Queries" button, you will get a query with above filter. (This section can even remove the need for that query...)
Note: at present time, works only in VSTS.
https://{org}.visualstudio.com/{project}/_workitems/mentioned/
This would achieve the same result.
There is no way to achieve this by work item query directly just as starain mentioned. You can create a custom hub or custom widget by using VSTS Extension to show these information in web portal.
You can’t achieve that through work item query directly, you could build a app to retrieve data through REST API (https://www.visualstudio.com/en-us/docs/integrate/api/wit/wiql), change query text according different conditions (e.g. users)
Your query should be something like this
Select Id,Title From WorkItems Where ID IN (#RecentMentions) order by [System.ChangedDate] desc
here is the reference for rest of the macro's available in ADO rest API.
https://learn.microsoft.com/en-us/azure/devops/boards/queries/query-operators-variables?view=azure-devops