Developer Portal for YouTrack and Hub 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.

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}', ctx.currentUser ).first(); if (firstIssue) { // Process the first matching issue. }
04 September 2026