YouTrack Standalone 2017.4 Help

Apply Command to an Issue

POST /issue/{issue}/execute

Apply a command to an issue.

POST /rest/issue/{issue}/execute?{command}&{comment}&{group}&{disableNotifications}&{runAs}

Parameters:

Name Type Description
issue issueById A command will be applied to an issue with this issueID.
command string A command to apply. A command might content a string of attributes and their values, that is: You can change multiple fields with one complex command. For example, the following command will set an issue's Type=Bug, Priority=Critical, Fix version=5.1, and will add tag "regression":
Type Bug Priority Critical add Fix versions 5.1 tag regression

For more details about YouTrack commands, please take a look at the basic description and Command Reference.

comment string A comment to add to an issue.
group string User group name. Use to specify visibility settings of a comment to be post.
disableNotifications boolean If set 'true' then no notifications about changes made with the specified command will be send. By default, is 'false'.
runAsstringLogin for a user on whose behalf the command should be executed.

To use runAs parameter you should have 'Update project' permission in the project, to which the issue belongs. For more information about permissions see Permissions Reference

Samples

Sample 1

Request

The following request applies command for the issue with ID "HBR-60" and sets issue Type to "exception" and simultaneously adds a comment "exception naturally!":

POST http://localhost:8081/rest/issue/HBR-60/execute Content-Length: 46 Connection: keep-alive Content-Type: application/x-www-form-urlencoded Cookie: $Version=0; JSESSIONID=n7hq7t8o49ae15sgbq5hn9ic; $Path=/; jetbrains.charisma.main.security.PRINCIPAL=MTVhMjY2OGUxMTUxMTI5MGMzNjhlZWM5NTJiNGJkNmIyNzc3NjdjZmM3YWU4MTVjYzQwYWE1MWZlYTkwNTcxNzphcHBfZXhjZXB0aW9u; $Path=/ command=exception&comment=exception naturally!

Response

HTTP/1.1 200 OK Content-Type: application/xml;charset=UTF-8 Content-Length: 0

Sample 2

The command in this sample is applied to the issue "TP-30" and sets its Priority to "Major" and State to "Fixed".

Request

POST /youtrack/rest/issue/TP-30/execute HTTP/1.0 Host: sample.myjetbrains.com Content-Length: 41 Content-Type: application/x-www-form-urlencoded Cookie: JSESSIONID=dxe03plylrrg1nkwf23twrl49; Path=/youtrack; jetbrains.charisma.main.security.PRINCIPAL=ZmNhNzIwYmQwYyM0YjNjMWYyNzQ4MjRiMDgzZDNhNGVlZjEwZGFlOTAwNmZlOTZmZDNiYzJiMzIyYWZlMDM5ZDpyb290; Path=/youtrack; command=Priority%20Major%20State%20Fixed

Response

HTTP/1.1 200 OK Server: nginx Date: Tue, 21 Jan 2014 11:08:05 GMT Content-Type: application/xml; charset=UTF-8 Content-Length: 0 Connection: close

Sample 3

Below you will find a sample of an erroneous command.

Request

POST /youtrack/rest/issue/TP-30/execute HTTP/1.0 Host: sample.myjetbrains.com Content-Length: 41 Content-Type: application/x-www-form-urlencoded Cookie: JSESSIONID=dxe03plylrrg1nkwf23twrl49; Path=/youtrack; jetbrains.charisma.main.security.PRINCIPAL=ZmNhNzIwYmQwYyM0YjNjMWYyNzQ4MjRiMDgzZDNhNGVlZjEwZGFlOTAwNmZlOTZmZDNiYzJiMzIyYWZlMDM5ZDpyb290; Path=/youtrack; command=Priority%20Major%20State%20Fixes

Response

HTTP/1.1 400 Bad Request Server: nginx Date: Tue, 21 Jan 2014 11:10:24 GMT Content-Type: application/xml; charset=UTF-8 Content-Length: 108 Connection: close <?xml version="1.0" encoding="UTF-8" standalone="yes"?><error>Unknown command: State expected: Fixes</error> Connection closed by foreign host.
Last modified: 12 December 2017