The goals_search query supports a powerful search query language for filtering goals. This guide explains the query syntax, available fields, operators, sorting, pagination, and query cost limits.
The query syntax is inspired by JQL (Jira Query Language) and is designed to be human-readable and flexible. You pass search queries as the searchString parameter to goals_search.
Here's a simple example that searches for all goals with "Q3" in their name:
1 2query { goals_search( containerId: "ari:cloud:townsquare::site/{siteId}" searchString: "name LIKE Q3" first: 10 ) { edges { node { name status { value } } } pageInfo { hasNextPage endCursor } } }
And here's a cURL command for the same query:
1 2curl -X POST 'https://{subdomain}.atlassian.net/gateway/api/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <YOUR_BASE_64_TOKEN_HERE>' \ --data '{"query":"query { goals_search(containerId: \"ari:cloud:townsquare::site/{siteId}\", searchString: \"name LIKE Q3\", first: 10) { edges { node { name status { value } } } pageInfo { hasNextPage endCursor } } }"}'
A search query is made up of one or more clauses. Each clause has the form:
1 2field operator value
For example:
name = "My Goal" — exact match on namename LIKE roadmap — partial/fuzzy match on namestatus = on_track — filter by statusarchived = false — exclude archived goalsowner = "60eeec6bf749c4006801261b" — filter by owner's Atlassian account IDIf a value contains spaces, wrap it in double quotes: name LIKE "product launch".
You can combine multiple clauses with AND and OR:
status = on_track AND owner = "60eeec6bf749c4006801261b" — both conditions must matchstatus = off_track OR status = at_risk — either condition can matchOperator precedence: AND binds more tightly than OR. Use parentheses to control grouping:
1 2(status = off_track OR status = at_risk) AND label = "engineering"
Parentheses can be nested to create complex queries:
1 2(name LIKE launch AND status = on_track) OR (label = "priority" AND owner = "60eeec6bf749c4006801261b")
The following operators are available (not all operators are supported by every field — see the field reference table below):
| Operator | Syntax | Description |
|---|---|---|
| Equals | = | Exact match |
| Not equals | != | Does not match |
| Like | LIKE | Partial/substring match (case-insensitive) |
| Greater than | > | Greater than (for dates, scores, etc.) |
| Greater than or equal | >= | Greater than or equal to |
| Less than | < | Less than |
| Less than or equal | <= | Less than or equal to |
| Is | IS | Checks for a property (e.g., startDate IS EMPTY) |
| Is not | IS NOT | Negation of IS (e.g., startDate IS NOT EMPTY) |
| Is in | IS IN | Matches any value in a list |
| Is not in | IS NOT IN | Matches none of the values in a list |
The following fields are available when searching goals with goals_search:
| Field | Aliases | Operators | Description |
|---|---|---|---|
name | — | =, LIKE | Goal name |
key | — | =, !=, LIKE, IS IN, IS NOT IN | Goal key (e.g., ATL-01) |
owner | — | =, != | Atlassian account ID of the goal owner |
team | — | =, != | Team ID |
status | — | =, != | Status value: on_track, off_track, at_risk |
phase | — | =, != | Phase: pending, in_progress, done, paused, cancelled |
status_phase | — | =, != | Combined status and phase query. Accepts both status values (e.g., on_track) and phase values (e.g., in_progress) |
score | — | =, !=, >, <, >=, <= | Goal score (numeric) |
label | tag, topic | =, LIKE | Label/tag name |
archived | — | =, != | true or false |
goalType | — | =, IS IN | Goal type ID |
parentGoal | — | = | Parent goal ID |
number | — | = | Goal number |
metric | — | = | Metric ID. Filter goals by an attached metric |
watcher | — | =, != | Atlassian account ID of a watcher |
starred | — | = | Whether the goal is starred by the current user (true / false) |
startDate | — | =, >, <, >=, <=, IS, IS NOT | Start date (format: YYYY-MM-DD). Use IS EMPTY / IS NOT EMPTY to check presence. |
targetDate | — | =, >, <, >=, <= | Target date (format: YYYY-MM-DD) |
creationDate | — | =, >, <, >=, <= | When the goal was created |
focusAreaAris | — | =, IS IN | Focus area ARI |
search | — | LIKE | Searches across goal name and tags |
reporting_line | — | = | Atlassian account ID. Finds goals owned by a user or their reports |
You can sort results by passing a sort parameter to goals_search. The available sort options are:
CREATION_DATE_ASC, CREATION_DATE_DESC, NAME_ASC, NAME_DESC, SCORE_ASC, SCORE_DESC, TARGET_DATE_ASC, TARGET_DATE_DESC, LATEST_UPDATE_DATE_ASC, LATEST_UPDATE_DATE_DESC, WATCHING_ASC, WATCHING_DESC
goals_search supports cursor-based pagination using the standard Relay connection pattern:
first — the maximum number of results to return per pageafter — a cursor string from a previous response, indicating where to continueEvery response includes a pageInfo block:
1 2pageInfo { startCursor endCursor hasNextPage hasPreviousPage }
To fetch the next page, pass the endCursor value from the previous response as the after parameter in your next request.
1 2query { goals_search( containerId: "ari:cloud:townsquare::site/{siteId}" searchString: "status = on_track" first: 25 after: "eyJpZCI6MTAwfQ==" ) { edges { node { name } } pageInfo { endCursor hasNextPage } } }
1 2query { goals_search( containerId: "ari:cloud:townsquare::site/{siteId}" searchString: "status = on_track AND owner = \"{accountId}\"" first: 10 sort: [NAME_ASC] ) { edges { node { name status { value } owner { aaid } targetDate } } pageInfo { hasNextPage endCursor } } }
1 2query { goals_search( containerId: "ari:cloud:townsquare::site/{siteId}" searchString: "targetDate >= 2026-01-01 AND targetDate <= 2026-03-31" first: 50 sort: [TARGET_DATE_ASC] ) { edges { node { name targetDate phase { name } } } } }
The search field searches across goal name, tags, and key. Use the LIKE operator:
1 2query { goals_search( containerId: "ari:cloud:townsquare::site/{siteId}" searchString: "search LIKE \"quarterly revenue\"" first: 10 ) { edges { node { name owner { aaid } } } } }
The reporting_line field finds goals owned by a specific user or anyone in their reporting chain (direct and indirect reports). Pass the manager's Atlassian account ID:
1 2query { goals_search( containerId: "ari:cloud:townsquare::site/{siteId}" searchString: "reporting_line = \"{managerAccountId}\" AND phase = in_progress" first: 50 sort: [TARGET_DATE_ASC] ) { edges { node { name owner { aaid } status { value } targetDate } } } }
1 2query { goals_search( containerId: "ari:cloud:townsquare::site/{siteId}" searchString: "reporting_line = \"{managerAccountId}\" AND search LIKE \"revenue\" AND status_phase = on_track" first: 10 ) { edges { node { name owner { aaid } score } } } }
To protect system performance, each search query has a complexity budget. Every field clause in your query adds a cost, and if the total cost meets or exceeds the budget, the query will be rejected with an error.
Goals budget: 30
Each clause in your query adds the following cost based on the field used:
| Cost | Fields |
|---|---|
| 1 | name, key, owner, status, phase, status_phase, archived, score, number, parentGoal, startDate, targetDate, creationDate |
| 2 | team, watcher, metric, goalType |
| 5 | label / tag / topic, search, reporting_line, starred, focusAreaAris |
For example, a query like search LIKE "revenue" AND reporting_line = "{id}" AND label = "finance" has a total cost of 5 + 5 + 5 = 15, which is within budget. But combining six cost-5 fields would hit 30 and be rejected.
If your query is rejected for being over budget, simplify it by reducing the number of expensive clauses or splitting the query into multiple requests.
AND and OR, use parentheses to make your intent clear.name LIKE "product launch").LIKE, like, and Like all work.Name, name, and NAME all work.search for broad queries: The search field searches across name and tags. Use it with LIKE."" as the searchString.Rate this page: