Creating an auto action
Use this request to create an auto action.
POST
https://api.tracker.yandex.net/v3/queues/<queue_ID>/autoactions
Query format
Before making a request, get permission to access the API.
To create an auto action, use an HTTP POST
request. In the request body, specify the parameters in JSON format.
POST /v3/queues/<queue_ID>/autoactions
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-Org-ID: <organization_ID>
{
"name": "<autoaction_name>",
"filter": [<filtering_conditions>],
"actions": [<action_parameters>]
}
Headers
-
Host
: Address of the node that provides the API. -
Authorization
: Authorization token about these formats:-
OAuth <OAuth_token>
: For authorization using the OAuth 2.0 protocol. Learn more -
Bearer <IAM_token>
: For authorization using an IAM token, if a Yandex Cloud Organization organization is linked to Tracker. Learn more
-
-
X-Org-ID
orX-Cloud-Org-ID
: Organization ID.-
Use the
X-Org-ID
header if a Tracker organization is linked to Yandex 360 for Business. -
Use the
X-Cloud-Org-ID
header if a Tracker organization is linked to Yandex Cloud Organization.
To get the organization ID, go to Administration → Organizations and copy the value from the ID field.
-
Resource
Parameter | Description | Data type |
---|---|---|
<queue_ID> | Queue ID or key. The queue key is case-sensitive. | String or number |
Request body parameters
Required parameters
In the request body, specify at least one of the parameters: filter
or query
.
Parameter | Description | Data type |
---|---|---|
name | Auto action name | String |
filter | Array with the issue field filtering conditions that will trigger the auto action | Array of objects |
query | The query string to filter the issues that will trigger the auto action. The query language is used. For example: "query": "\"Status\":\"In progress\"" |
String |
actions | Array of actions on issues | Array of objects |
Additional parameters
Parameter | Description | Data type |
---|---|---|
active | Auto action status. Acceptable values include:
|
Boolean |
enableNotifications | Notification sending statuses. Acceptable values include:
|
Boolean |
intervalMillis | Auto action start frequency in milliseconds. The default value is 3600000 (once an hour). |
Number |
calendar | Period for which the auto action is active. It has the id parameter specifying the work schedule ID. |
Map item |
Example: Creating an auto action that triggers on issues that meet the filter criteria and changes the status of the issues.
- An HTTP POST method is used.
- Create an auto action for the DESIGN queue.
- Filter criteria: issues in the
In progress
status with Priority set toCritical
.- Action performed: the issue status changes to Need info.
- Trigger period: work schedule with the ID of
2
.
POST /v3/queues/DESIGN/autoactions Host: api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID or X-Cloud-Org-ID: <organization_ID> { "name": "AutoactionName", "filter": { "priority": [ "critical" ], "status": [ "inProgress" ] }, "actions": [ { "type": "Transition", "status": { "key": "needInfo" } } ], "calendar": { "id": 2 } }
Response format
If the request is successful, the API returns a response with code 200 OK
.
The request body contains information about the created auto action in JSON format.
{
"id": 9,
"self": "https://api.tracker.yandex.net/v3/queues/DESIGN/autoactions/9",
"queue": {
"self": "https://api.tracker.yandex.net/v3/queues/DESIGN",
"id": "26",
"key": "DESIGN",
"display": "Design"
},
"name": "autoaction_name",
"version": 1,
"active": true,
"created": "2022-01-21T17:10:22.993+0000",
"updated": "2022-01-21T17:10:22.993+0000",
"filter": {
"assignee": [
"13********"
],
"priority": [
"critical"
]
},
"actions": [
{
"type": "Transition",
"id": 1,
"status": {
"self": "https://api.tracker.yandex.net/v3/statuses/2",
"id": "2",
"key": "needInfo",
"display": "Need info"
}
}
],
"enableNotifications": false,
"totalIssuesProcessed": 0,
"intervalMillis": 3600000,
"calendar": {
"id": 2
}
}
Response parameters
Parameter | Description | Data type |
---|---|---|
id | Auto action ID | String |
self | Link to the auto action | String |
queue | Queue to create the auto action. | Can be set as an object, a string (if the queue key is provided), or a number (if the queue ID is provided). |
name | Auto action name | String |
version | Auto action version. Each change to the auto action increases the version number. | Number |
active | Auto action status. Acceptable values include:
|
Boolean |
created | Auto action creation date and time in YYYY-MM-DDThh:mm:ss.sss±hhmm format |
String |
updated | Date and time of the auto action's last update in YYYY-MM-DDThh:mm:ss.sss±hhmm format |
String |
filter | Array with the issue field filtering conditions that will trigger the auto action | Array of objects |
query | Query string for filtering issues | String |
actions | Array of actions on issues | Array of objects |
enableNotifications | Notification sending statuses. Acceptable values include:
|
Boolean |
totalIssuesProcessed | Number of issues checked by the auto action when triggered last time | Number |
intervalMillis | Auto action start frequency in milliseconds. The default value is 3600000 (once an hour). |
Number |
calendar | Period for which the auto action is active. It has the id parameter specifying the work schedule ID. |
Map item |
queue
object fields
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 |
filter
array object fields
Parameter | Description | Data type |
---|---|---|
filter | Array with filtering conditions for issue fields. Use the request to get the ID of the global or local field. |
Array of objects |
actions
array object fields
Parameter | Description | Data type |
---|---|---|
type | Action type. Acceptable values include:
|
String |
id | Action ID | String |
status | Issue status | String |
status
array object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the status. | String |
id | Status ID. | String |
key | Status key. | String |
display | Status name displayed. | String |
If the request is processed incorrectly, the API returns a message with error details:
- 400
- One or more request parameters have an invalid value.
- 403
- You are not authorized 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.
- 422
- JSON validation error, the request is rejected.
- 500
- Internal service error. Try again later.
- 503
- The API service is temporarily unavailable.