search
This module provides a function for searching for issues in YouTrack.
search
Returns issues that match a search query.
For supported query operators and attributes, see Search and Command Attributes.
Parameters
Name | Type | Description |
|---|---|---|
folder | 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 | 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
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 ornullwhen 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, andslice()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.