Get a macro
Written by
Use this request to get macro parameters.
Request format
Before making the request, get permission to access the API.
To get macro parameters, use an HTTP GET
request:
GET /v2/queues/<queue-id>/macros/<macros-id>
Host: https://api.tracker.yandex.net
Authorization: OAuth <token>
X-Org-ID: <organization ID>
Headers
-
Host
Address of the node that provides the API:
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 |
<macros-id> | Macro ID. | String |
Response format
Successful execution of the request
The request failed
If the request is successful, the API returns a response with code 200 OK
.
The response body contains a JSON object with macro parameters.
{
"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 comment\n{{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. | Objects |
name | Macro name. | String |
body | Message to be created when executing the macro. Format: <Message text>\n<variable> where:
"body": {"unset":1} |
String |
fieldChanges | Array with information about the issue fields that the macro will trigger changes to. | Array of objects |
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. | Objects |
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 again later.
- 503
- The API service is temporarily unavailable.