Portfolio Item Query Examples

The Query field , 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 work items .

Query field


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))

Unscheduled Features

(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")
Note: Querying in WSAPI for a portfolio item state , such as a state of Done, results in an error. To view results based on portfolio item state, you can use the filter field on the Custom List app.

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")
Tip: Use the following date variables and date expressions: today, yesterday, tomorrow, lastweek, nextweek, lastmonth, nextmonth, lastquarter, nextquarter, lastyear, next year, today + <days>, and today - <days>. For examples and usage details, see Date Variables.

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 user 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 iteration that roll up to a leaf level PI ( Feature ) assigned to release 2014.Q2:

(((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)))

Useful Fields

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.

Syntax Description
AcceptedLeafStoryCount The number of user stories (without children) associated to a portfolio item with a state of Accepted.
ActualStartDate 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.
Description Searches contents of the Description field. You can use contains or !contains conditions.
LastUpdateDate The last date the portfolio item was edited or created, which can also be updated when associated work items are edited.
LeafStoryCount The number of user stories (without children) associated to a portfolio item.
Parent The next level up in your portfolio item hierarchy. Use this field to locate a group of portfolio items with a common parent.
PercentDoneByStoryCount The percentage of user stories (without children) associated to a portfolio item that have a state of Accepted.
PercentDoneByStoryPlanEstimate The percentage of user story (without children) plan estimates associated to a portfolio item that have a state of Accepted.
PlannedStartDate The date work is anticipated to begin on the portfolio item.
State The Kanban state of a portfolio item. Not to be confused with the Schedule State field of associated user stories.

Common Problems

If your query is not returning the data you expect, see the suggestions below.

Type Settings

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 hierarchy .

Custom List App

Custom List

Portfolio Kanban Board App

Portfolio Kanban

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"))

Correct syntax

((Tags.Name = "Blue") AND (Tags.Name = "Green"))

Also remember that custom fields in your workspace begin with "c_". For a custom field named Color:


(Color = "Blue")


(c_Color = "Blue")

Case Sensitivity

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 ( Owner .UserName = "[email protected]") will not work. The value must match exactly in the query.

Project Settings

Ensure that your project scoping in the app settings menu is correct. A query will not return work items that reside in projects outside of your selection.

User Permissions

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.


Need more help? The CA Agile Central Community is your one-stop shop for self-service and support. To submit feedback or cases to CA Agile Central Support, find answers, and collaborate with others, please join us in the CA Agile Central Community.