llms.txt: machine-readable documentation index. Markdown version of this page is also available.

YouTrack Developer Portal Help

search

This module provides a function for searching for issues in YouTrack.

static search(folder, query, user)

Returns issues that match a search query.

For supported query operators and attributes, see Search and Command Attributes.

Parameters

Name

Type

Description

folder

WatchFolder

The project, tag, or saved search to set as the search context.

If omitted, the search includes all issues. This is equivalent to selecting Everything as the search context in the user interface.

query

string, Object

A YouTrack search query.

When this parameter is an object, you can search by extension properties.

user

User

The user on whose behalf the query is executed.

The results exclude issues that this user does not have permission to view.

If omitted, the query is executed on behalf of the current user.

Return Value

Type

Description

Set .< Issue >

The issues that match the query.

Working with Results

The function returns a Set of Issue objects. Use Set methods to select or process the results:

  • first() returns the first issue or null when the set is empty.

  • find() returns the first issue that matches a predicate.

  • forEach() processes every matching issue.

  • In YouTrack 2025.3 and later, map() transforms results into a JavaScript array, and slice() copies a range into an array.

These methods follow the query's result order. Specify a sort order in the query when selecting the first result or a range of results. The slice() method traverses results to select a range; it does not provide database pagination.

For array operations and collection conversion, see Convert to an Array.

Examples

const search = require('@jetbrains/youtrack-scripting-api/search'); const issues = search.search( ctx.issue.project, 'for: me State: {In Progress}', ctx.currentUser );
const search = require('@jetbrains/youtrack-scripting-api/search'); const query = { query: 'project: APP', extensionPropertiesQuery: { service: 'billing', region: 'eu' } }; const issues = search.search(null, query, ctx.currentUser);
const search = require('@jetbrains/youtrack-scripting-api/search'); const firstIssue = search.search( ctx.issue.project, 'State: {In Progress} sort by: created asc', ctx.currentUser ).first(); if (firstIssue) { // Process the first matching issue. }
24 November 2026