This page shows examples of how to apply a command to one or more issues in YouTrack using its REST API. Just as the commands in UI, its REST API implementation lets you perform operations with one or several issues much faster and easier.
Minimal request to apply command
A minimal request for a command requires you to send in the request body a query to apply and a collection of issues that should be represented by their IDs.
The following request adds a tag to three issues and assigns them to user "jane.doe".
curl -L -X POST 'https://example.youtrack.cloud/api/commands' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \
--data-raw '{
"query":"tag To deploy for jane.doe",
"issues":[{"idReadable":"SP-3967"},{"idReadable":"SP-4032"},{"idReadable":"SP-3990"} ]
}'
Apply a command silently
Now let's apply a command silently. That is, the following request instructs YouTrack to not send notifications about the change. Such silent commands come handy when you need to update a significant number of issues simultaneously; For example, when you plan the next version release, or a milestone, and need to set or change version field.
To apply a command silently, all you need to do is to specify in the request payload the attribute "silent" set to true. In this sample we identified issues by their database entity id, not "idReadable" as in previous samples.