YouTrack Standalone 2019.2 Help

Command Suggestions

Lets you get suggestions for the currently entered command.

Resource

/api/commands/assist

Returned entity

CommandList. For the description of the entity attributes, see Supported Fields section.

Supported methods

CommandList attributes

Represents list of command and related comment in YouTrack. Can be used to either apply a command or get command suggestions.

This table describes attributes of the CommandList entity.

  • To receive an attribute in the response from server, specify it explicitly in the request parameter fields.

  • To update an attribute, provide it in the body of a POST request.

Field

Type

Description

comment

String

A comment to add to an issue. Can be null.

visibility

CommandVisibility

Stores visibility settings for a comment added with the command.

query

String

Stores a command to apply. Can be null.

caret

Int

Current caret position. End of current command by default.

silent

Boolean

If true, the command is applied without notification. The default value is false.

usesMarkdown

Boolean

When true, a comment added with the command is parsed as Markdown formatted. Otherwise, the comment is parsed as YouTrack Wiki formatted.

runAs

String

Login for a user on whose behalf the command is executed. To use the runAs parameter, you must have the Low-level Administration permission in the project for the target issue. Can be null.

commands

Array of ParsedCommands

Stores a collection of commands parsed from the provided query. Read-only.

issues

Array of Issues

Stores a collection of issues to which the current command applies.

suggestions

Array of Suggestions

Stores a collection of possible command suggestions. Read-only.

Read Command Suggestions

Get command suggestions for the specified query.

Request syntax

POST /api/commands/assist?{fields}

Request parameters

Parameter

Type

Description

fields

String

A list of CommandList attributes that should be returned in the response. If no field is specified,only the entityID is returned

Sample

Sample request URI

https://example.myjetbrains.com/youtrack/api/commands/assist?fields=caret,commands%28delete,description,error%29,query,styleRanges%28end,length,start,style%29,suggestions%28caret,className,comment,completionEnd,completionStart,description,group,icon,id,matchingEnd,matchingStart,option,prefix,suffix%29

Sample request body

{ "query": "sta", "caret": 3, "issues": [ { "id": "2-30" } ] }

Sample response body

{ "commands": [ { "description": "unknown command: sta", "delete": false, "error": true } ], "styleRanges": [ { "start": 0, "style": "error", "length": 3 } ], "suggestions": [ { "icon": null, "description": "change star", "completionEnd": 3, "caret": 5, "completionStart": 0, "matchingEnd": 3, "matchingStart": 0, "group": null, "prefix": null, "option": "star", "suffix": " ", "id": "star", "className": null }, { "icon": null, "description": "change State", "completionEnd": 3, "caret": 6, "completionStart": 0, "matchingEnd": 3, "matchingStart": 0, "group": null, "prefix": null, "option": "State", "suffix": " ", "id": "State", "className": null } ], "caret": 3, "query": "sta" }
Last modified: 17 December 2019