Get queue macros
Written by
Use this request to get parameters of all macros in a queue.
Request format
Before making the request, get permission to access the API.
To get parameters of all macros in a queue, use an HTTP GET
request:
GET /v2/queues/<queue-id>/macros
Host: https://api.tracker.yandex.net
Authorization: OAuth <token>
X-Org-ID: <organization ID>
Headers
-
Host
API host address:
https://api.tracker.yandex.net
-
Authorization
OAuth token in
OAuth <token value>
format. For example:OAuth 0c4181a7c2cf4521964a72ff57a34a07
-
X-Org-ID
Organization ID.
Resource
Parameter | Description | Data type |
---|---|---|
<queue-id> | Queue ID or key. The queue key is case-sensitive. | String |
Response format
Request executed successfully
Request failed
If the request is successful, the API returns a response with code 200 OK
.
The response body contains a JSON array with the parameters of all queue macros.
[
{
"self": "https://api.tracker.yandex.net/v2/queues/TEST/macros/3",
"id": 3,
"queue": {
"self": "https://api.tracker.yandex.net/v2/queues/TEST",
"id": "1",
"key": "TEST",
"display": "Test queue"
},
"name": "Test macro",
"body": "Test message\n{{currentUser}}{{currentDateTime.date}}{{currentDateTime}}\n{{issue.author}}",
"fieldChanges": [
{
"field": {
"self": "https://api.tracker.yandex.net/v2/fields/tags",
"id": "tags",
"display": "Tags"
},
"value": [
"tag1", "tag2"
]
},
...
]
},
...
]
Response parameters
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with macro parameters. | String |
id | Macro ID. | Number |
queue | Object with information about the queue whose issues that the macro is applied to. | Object |
name | Macro name. | String |
body | Message to be created when executing the macro. Format: <Message text>\n<variable> where:
"body": {"unset":1} |
String |
Object fields queue
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the queue. | String |
id | Queue ID. | String |
key | Queue key. | String |
display | Queue name displayed. | String |
Array objects fieldChanges
Parameter | Description | Data type |
---|---|---|
field | Object with information about the issue field. | Object |
value | Array of issue field values. | Array of objects |
Object fields field
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the issue field. | String |
id | Issue field ID. | String |
display | Issue field name displayed. | String |
If the request is processed incorrectly, the API returns a response with an error code:
- 400
- One or more request parameters have an invalid value.
- 403
- Insufficient rights to perform this action. You can check what rights you have in the Tracker interface. The same rights are required to perform an action via the API and interface.
- 404
- The requested object was not found. You may have specified an invalid object ID or key.
- 500
- Internal service error. Try resending your request in a few minutes.
- 503
- The API service is temporarily unavailable.