, available in Custom List and Portfolio Kanban Board apps, provides you with a way to filter the data displayed using multiple criteria. You can enter SQL-style queries into the field to find specific portfolio items or their associated
See the following examples for common portfolio item queries.
Portfolio Items With Specific Text in the Name
This example is useful if you use various naming conventions to identify different groups of portfolio items:
(Name contains "Technical Debt")
Portfolio Items With a Specific Investment Category
(InvestmentCategory = "Cost Savings")
Portfolio Items With a Specific Custom Field Value
(c_MyCustomField = "MyCustomValue")
Create a Custom Grid That Shows All Leaf Stories Attached to a Feature
((Feature.FormattedID = F3550) AND (DirectChildrenCount = 0))
(Release = null)
Features in Current Release
((Release.ReleaseStartDate <= today) AND (Release.ReleaseDate >= today))
Leaf User Stories Attached to Features in Current Release
(((Feature.Release.ReleaseStartDate <= today) AND (Feature.Release.ReleaseDate >= today)) AND (DirectChildrenCount = 0))
Scheduled for a Release
(Release.Name = "PSI 2013.Q1")
Portfolio Items With a Specific Parent
(Parent.Name = "Design new login page")
Portfolio Items With No Parent
(Parent = null)
Portfolio Items With No Child Portfolio Items or User Stories
(DirectChildrenCount = "0")
Portfolio Items That Have a State Other Than Discovering or Done
((State.Name !="Discovering") AND (State.Name !="Done"))
Portfolio Items That Have a State Between Discovering and Done
In this example, the State field on portfolio items uses an ordered value to identify the custom states. Discovering is the first available state, and has a value of 1. Done is the final state, and has a value of 4:
((State.OrderIndex > 1) AND (State.OrderIndex < 4))
Portfolio Items That Have Total Completion Percent (by Story Count) of 50% or Less
(PercentDoneByStoryCount <= ".50")
Portfolio Items That Do Not Have Tags That Contain Specific Text
(Tags.Name !contains "Blue")
Portfolio Items With Two Tags: Red and Blue
((Tags.Name = "Blue") AND (Tags.Name = "Red"))
Portfolio Items With Three Rags: Red, Blue, and Green
(((Tags.Name = "Blue") AND (Tags.Name = "Red")) AND (Tags.Name = "Green"))
Portfolio Items Owned by Mike or Sally
((Owner.UserName = "[email protected]") OR (Owner.UserName = "[email protected]"))
Portfolio Items That Have an Actual Start Date After November 5, 2012
(ActualStartDate > "2012-11-05")
Portfolio Items That Have a Planned Start Date Later Than Last Week
(PlannedStartDate > "lastweek")
(PlannedStartDate > "today - 7")
Portfolio Items That Have Planned Dates, But Not All Associated User Stories are Finished
(((PlannedStartDate != null) AND (PlannedEndDate != null)) AND (PercentDoneByStoryCount <= ".50"))
All Child Stories Under a Specific Portfolio Item
Set a custom grid app to view
stories, then enter the FormattedID of the parent portfolio item in the query:
(PortfolioItem.FormattedID = "F123")
Query on Stories in a Story Hierarchy That Rollup to a Leaf Portfolio Item Allocated to a Specific Release
In this example, we display a custom grid showing leaf stories not allocated to an
to a leaf level PI (
) assigned to
(((Feature.Release.Name = "2014.Q2") AND (Iteration.Name = null)) AND (DirectChildrenCount = 0))
Filter Out Features With No State or Archived Features
((Tags.Name = "RPM") AND (State.Name != null) AND (State.Name != "Archived"))
Portfolio Items In Progress
((PercentDoneByStoryCount > 0) AND (PercentDoneByStoryCount < 1))
This includes portfolio items that have had at least one story accepted.
((ActualStartDate != null) AND (ActualEndDate = null))
This includes portfolio items that have stories in progress but nothing has been accepted yet.
Finished Portfolio Items
((ActualStartDate != null) AND (ActualEndDate != null))
Recent Portfolio Items and Portfolio Items In Progress
(((ActualStartDate != null) AND (ActualEndDate = null)) OR ((ActualStartDate != null) AND (ActualEndDate = LastQuarter)))
Below are some fields that may help you build a specific query. Not all fields are listed. To see if a field is available for use, check your Web Services API documentation.
||The number of user stories (without children) associated to a portfolio item with a state of Accepted.
||The date work actually began on a portfolio item, generated when the first lowest-level story associated to a portfolio item is set with a state of In-Progress.
||Searches contents of the Description field. You can use contains or !contains conditions.
||The last date the portfolio item was edited or created, which can also be updated when associated work items are edited.
||The number of user stories (without children) associated to a portfolio item.
||The next level up in your portfolio item hierarchy. Use this field to locate a group of portfolio items with a common parent.
||The percentage of user stories (without children) associated to a portfolio item that have a state of Accepted.
||The percentage of user story (without children) plan estimates associated to a portfolio item that have a state of Accepted.
||The date work is anticipated to begin on the portfolio item.
||The Kanban state of a portfolio item. Not to be confused with the Schedule State field of associated user stories.
If your query is not returning the data you expect, see the suggestions below.
The Type field in app settings controls what level of portfolio items will be displayed. If your query does not return any results, you may be viewing the wrong level of the portfolio
Custom List App
Portfolio Kanban Board App
Correct Parentheses Syntax
Parentheses used in queries with multiple conditions must be balanced. For every condition in the query, you must add one ( to the front of the string. You must also end each condition beyond the first with )).
((Name = "A") AND (Name = "B") AND (Name = "C"))
(((Name = "A") AND (Name = "B)) AND (Name = "C"))
Correct Field Name Syntax
While reviewing the Web Services API documentation, be sure to remember that many fields are objects, which contain child elements. For example, Tags are an object in CA Agile Central, but have an element to locate the Name.
May return inconsistent results
((Tags = "Blue") AND (Tags = "Green"))
((Tags.Name = "Blue") AND (Tags.Name = "Green"))
Also remember that custom fields in your
begin with "c_". For a
(Color = "Blue")
(c_Color = "Blue")
Note that field values must be queried using the correct case. For example, if a username in CA Agile Central is capitalized as [email protected], a query formatted as (
.UserName = "[email protected]") will not work. The value must match exactly in the query.
Ensure that your
scoping in the app settings menu is correct. A query will not return work items that reside in projects outside of your selection.
Queries will not return work items that reside in projects you do not have permission to view. Ensure that you have permissions in the projects you want to query.
How to Build Queries
Learn more about formatting syntax in the Query field.