---
metadata:
  - property: og:type
    content: article
  - property: article:section
    content: Автоматизации
  - property: og:title
    content: Как настроить действие триггера
  - property: article:tag
    content: Техническая инструкция
  - name: generator
    content: Diplodoc Platform v5.70.0
alternate:
  - https://yandex.ru/support/tracker/en/user/set-action.md
  - https://yandex.ru/support/tracker/ru/user/set-action.md
  - href: https://yandex.ru/support/tracker/en/user/set-action.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.ru/support/tracker/en/llms.txt?revision=r22105730
    rel: describedby
title: How to set up a trigger action in Yandex Tracker
description: In this tutorial, you will learn how to set up a trigger action.
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/tracker/en/llms.txt?revision=r22105730


# How to set up a trigger action

Under ![](../_assets/svg/arrow-icon-for-autoaction.svg) **Perform actions**, set up one or more actions:

- ![](../_assets/svg/check-in-round.svg)</svg> [**Change issue status**](#change-status)
- ![](../_assets/svg/add-task.svg)</svg> [**Create issue**](#create-issue)
- ![](../_assets/svg/icon-card.svg)</svg> [**Change field value**](#change-field-value)
- ![](../_assets/svg/add-to-sprint.svg)</svg> [**Add issue to active sprint**](#add-to-sprint)
- ![](../_assets/svg/move-task.svg)]</svg> [**Move issue**](#sec_move)
- ![](../_assets/svg/comment.svg)</svg> [**Add comment to issue**](#create-comment)
- ![](../_assets/svg/create-checklist.svg)</svg> [**Create checklist**](#create-checklist)
- ![](../_assets/svg/value.svg)</svg> [**Calculate value**](#calculate-value)
- ![](../_assets/svg/query-language.svg)</svg> [**HTTP request**](#create-http)

You can add up to 10 actions to one trigger.

![Trigger creation form and action selector](../_assets/automation/trigger-form.png =700x){.border-yes}

## Changing issue status {#change-status}

Set a new issue status. Available statuses may vary depending on the [workflow](https://yandex.ru/support/tracker/en/manager/workflow-status-edit.md) settings.

{% note warning "" %}

The trigger performs actions on behalf of the user whose issue change fired the trigger (except for the [HTTP request](#create-http) action, which is performed on behalf of the owner of the token specified in it). For the status transition to work:

- If certain [conditions are set up](https://yandex.ru/support/tracker/en/manager/workflow-action-edit.md#conditions) for status transitions and they restrict user permissions to change a status, make sure the user who fires the trigger has the required permissions.

- If you set up a [transition screen](https://yandex.ru/support/tracker/en/manager/workflow-action-edit.md#set-transition) for a status update, make sure it does not have required fields or fill them in with the trigger's previous actions.

{% endnote %}


## Creating an issue {#create-issue}

You can set up a trigger that will automatically create an issue when certain conditions are met. For example, you can set up a trigger that creates an issue for testing when a programmer implements a new feature and updates the issue status to **Resolved**.

{% note info "" %}

The trigger won't create a new issue if it runs within an issue that was automatically created by a trigger or [auto action](https://yandex.ru/support/tracker/en/user/ticket-schedule.md).

{% endnote %}

To set up creation of an issue:

1. Fill in the new issue's template fields:
    - Specify the queue where the issue will be automatically created.
    - Set issue parameters and click **Save**.

1. If you want the Yandex Tracker robot to be the issue author, select **Create as robot**. Make sure that the robot has rights for creating issues in the selected queue.

   If the option is disabled, the user whose action fired the trigger will be assigned as the issue's author. In this case, the issue will be created only if the user has rights for creating issues in the selected queue.

1. If you want to link the issue that enabled the trigger to the issue created by that trigger, select **Link with initial issue**.

You can configure automatic creation of multiple issues.


## Updating fields {#change-field-value}

Set one or multiple issue parameters:

1. Click ![](../_assets/svg/add-icon.svg)</svg> **Add parameter** and select an issue parameter.

    <!-- source: en/_includes/automation-list-delay.md -->
    {% note tip "" %}

    To find a [local queue field](https://yandex.ru/support/tracker/en/local-fields.md), enter the key of the queue where you want to set up an automation and a period before the field name (for example, `DEVS.Tester`).

    {% endnote %}
    <!-- endsource: en/_includes/automation-list-delay.md -->

1. Select an action:

    | **Action** | **Description** |
    ----- | -----
    | **Set value** | Specify the parameter value. |
    | **Clear field** | Delete a parameter value. |
    | **Add to list** | Add another parameter value (for parameters with multiple values). |
    | **Remove from list** | Remove a parameter value (for parameters with multiple values). |

1. Set a new value for the parameter.

<!-- source: en/_includes/automation-list-delay.md -->
{% note warning "" %}

You can't change the value of the **Parent ticket** field using an auto action.

{% endnote %}
<!-- endsource: en/_includes/automation-list-delay.md -->

## Adding an issue to an active sprint {#add-to-sprint}

Specify the name of the [board with a backlog and sprints](https://yandex.ru/support/tracker/en/manager/agile.md) where you want to add an issue.

## Moving an issue {#sec_move}

Select the queue to move your issue to.

The issue will be moved only if the user who ran the trigger has rights for creating issues in the selected queue.

## Adding comments to issues {#create-comment}

Write the comment text that will be added to an issue.

You can insert [values of issue fields](https://yandex.ru/support/tracker/en/user/vars.md) into the comment text. To do this, click ![](../_assets/console-icons/issues.svg)</svg> **Variables** and select one or more values. The comment field will show a sequence like `not_var{{issue.<field_key>}}`.

The comment is sent on behalf of the user who activates the trigger. If you want a robot to appear as the comment author, enable the **Send as robot** option.

## Create a checklist {#create-checklist}

Create a [checklist](https://yandex.ru/support/tracker/en/user/checklist.md) that will be added to an issue.

{% note info "" %}

The action won't work if the issue already contains a checklist.

{% endnote %}

To set up a checklist:

1. Click ![](../_assets/svg/add-icon.svg)</svg> **Add item**.
    You can add one or more items.

1. Enter a description for the item. If necessary, specify the assignee and deadline.

1. Click **Save**.


## Calculating a value {#calculate-value}

You can set up a special field whose values are calculated automatically based on values entered in other fields.

To calculate the field value automatically:

1. Set a formula for calculating the value:
    - Click ![](../_assets/console-icons/issues.svg)</svg> **Add variable** and add a field formula with numeric values. The formula will include a [sequence](https://yandex.ru/support/tracker/en/user/vars.md) like `not_var{{issue.<field_key>}}`.
      If the required field is missing in Yandex Tracker, you can [create it](https://yandex.ru/support/tracker/en/user/create-param.md).
    - You can use mathematical symbols for addition `+`, subtraction `-`, multiplication `*`, and division `/`.
    - To set the priority of operations, use parentheses.
    - To calculate values for date fields, you can use expressions with the `today()` function. For example, the `today()+3d` function returns the date that is three days from now.

    {% note warning "" %}

    The **Calculate value** action does not support local fields of the Date type. To calculate a date, select a global field of the Date type.

    {% endnote %}

1. Click **Select a field** and set the field you want to put the calculated value into.

    {% note info "" %}

    If the field supports only integer values, the value will be rounded.

    {% endnote %}

For an example of implementing the function, see [Add the current date to a field](https://yandex.ru/support/tracker/en/manager/trigger-examples.md#today).


## HTTP request {#create-http}

You can use HTTP requests to access the API of other services and set up integrations with them.

HTTP requests from different triggers are executed asynchronously. The execution order of requests is not guaranteed.


To send an HTTP request whenever the automation is triggered:

1. Select the HTTP request method.

1. Specify the [full URL of the resource](https://tools.ietf.org/html/rfc3986) to which the request will be sent. For example: `http://example.org/newfolder/newfile`.


1. Choose the authorization method:
    - **NoAuth**: No authorization.
    - [**Basic**](https://tools.ietf.org/html/rfc2617): You are prompted to enter your username and password.
    - [**OAuth 2.0**](https://tools.ietf.org/html/rfc6749): You are prompted to enter a token, authorization header, and token type.

1. When selecting the **Basic** or **OAuth 2.0** authorization type, enter authorization data.


   The authorization data (username, password, token, authorization header, token type) are transmitted in relevant fields and don't require to be re-entered in headers.

1. Enter the request body.

   You can add [issue field values](https://yandex.ru/support/tracker/en/user/vars.md) or custom variables to the request body. To do this, click ![](../_assets/console-icons/issues.svg)</svg> to the right of the field and choose the name for the field or value. The request body will include the `{{<variable_name>}}` sequence.

   {% note info "" %}

   You can also use variables in the resource URL and header value.

   {% endnote %}

1. Enter the headers and their values.

1. Add new variables if you need them in the request body or headers. For example, you can add an authentication key or other secret information.


   {% note info "" %}

   When you save the trigger, the variable's value is hidden, and you can't look it up later.

   {% endnote %}

When the automation is triggered, Tracker sends an HTTP request. The response can be any [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes).

If no response is received within 10 seconds, or if the response contains an error code, such as 500, the request will be resent. Each request will be retried up to 5 times, with the delay between attempts increasing exponentially from 10 seconds.


#### How to avoid processing a request twice {#http-idempotency-key}

The recipient of an HTTP request is the system that Tracker sends the request to. If no response arrives in time or the response contains an error code, such as 500, Tracker sends the request again. To prevent retries from creating duplicate issues or sending repeated notifications, configure idempotency key checks in the receiving system.

An idempotency key is a unique value that lets you distinguish a repeated delivery of a request from a new request. Tracker automatically adds it to every HTTP request in the `X-Tracker-Webhook-Idempotency-Key` header. The value is globally unique for one outgoing request and stays the same in all repeated deliveries of that request.

The `{{webhook.unique}}` variable contains the same value. If needed, use this variable to pass the key in the request body, URL, or a header value. For example, pass the key in the request body:

```json translate=no
{
    "issue": "{{issue.key}}",
    "idempotencyKey": "{{webhook.unique}}"
}
```

Configure the receiving system to store the keys of processed requests. Before performing an action, check whether the key has already been stored. If it has, do not perform the action again.

The key itself does not prevent repeated processing. Tracker does not guarantee that a request is delivered exactly once. For details about the variable, see [HTTP request idempotency key](https://yandex.ru/support/tracker/en/user/vars.md#webhook-variables).


#### Sample HTTP request settings {#http-examples}

- [Sending notifications from Yandex Tracker to messengers](https://yandex.ru/support/tracker/en/messenger.md)


- [Creating an issue with field values from its parent issue](https://yandex.ru/support/tracker/en/manager/trigger-examples.md#create-ticket-with-params)

- [Updating an issue status, priority, and adding a comment in related issues](https://yandex.ru/support/tracker/en/manager/trigger-examples.md#update-related-tasks)

<!-- source: en/_assets/style/image.md -->

<!-- endsource: en/_assets/style/image.md -->
