---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
  - property: og:type
    content: article
  - property: article:section
    content: Автоматизации
  - property: og:title
    content: Примеры использования триггеров в Трекере
  - property: article:tag
    content: Техническая инструкция
alternate:
  - https://yandex.ru/support/tracker/en/manager/trigger-examples.md
  - https://yandex.ru/support/tracker/ru/manager/trigger-examples.md
  - href: en/manager/trigger-examples.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
title: Examples of using triggers in Yandex Tracker
description: Learn how to use triggers in Yandex Tracker.
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/tracker/en/llms.txt


# Examples of using triggers in Tracker

{% list tabs accordion %}

- Examples with changing issue parameters

   * How to [automatically assign an issue assignee](#assign_ticket) based on status or component.
   * How to [automatically invite an issue assignee](#summon_ticket) based on status and field value.
   * How to [automatically add issues to a board](#board).
   * How to [automatically calculate the date difference](#tracker_data) in Tracker.
   * How to [add the current date to a field](#today).
   * How to [change issue priority after an SLA timer is triggered](#sla-excess).
   * How to [change issue status after posting a comment with specific text](#comment).
   * How to [change issue status after completing a checklist](#checklist-done).

- Examples with linked issues

   * How to [automatically change issue status](#new-link) if a link of a specific type was added to it.
   * How to [close a parent issue after closing all sub-issues](#sub-issues-done).

- Examples of integration with forms and email

   * How to [automatically send a notification to a user](#notify_mail) after creating an issue from a support request via email.
   * How to [automatically send a notification to a user](#notify_form) after creating an issue from a support request via Yandex Forms.
   * How to [automatically add a form](#insert_form) to issue comments.

- Examples of integration using HTTP requests

   * How to [set up notifications in messengers](#messengers) via HTTP requests.
   * How to [create a sub-issue and populate it with field values from the parent issue](#create-ticket-with-params).
   * How to [update status, priority, and add a comment in linked issues](#update-related-tasks).
   * How to [create a sub-issue with the text of the user's last comment](#create-ticket-with-user-last-comment).

{% endlist %}

## Automatically assign an issue assignee {#assign_ticket}

Often, specific employees are responsible for different stages of work. When an employee completes their part of the work, they pass the task to the next assignee. If the team works in Tracker, each work stage corresponds to an issue status. When an issue transitions to a specific status, you can use a trigger to automatically assign the employee responsible for that work stage.

Another way to organize work is when designated employees are responsible for different areas. For example, each support employee handles requests for their own product. In this case, you can [set up components](https://yandex.ru/support/tracker/en/manager/components.md) in the queue that correspond to the company's products. When a specific component is added to an issue, you can use a trigger to automatically assign the employee responsible for working with that product.

Let's set up a trigger for automatically assigning an issue assignee:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set conditions so that the trigger fires when the **Status** or **Components** issue parameters change:

    1. Add the condition **Event** → **Issue changed**.
    1. To assign an issue assignee when the status changes, add the condition **Status** → **became equal to** and specify the status. Available statuses depend on the [workflow](https://yandex.ru/support/tracker/en/manager/workflow.md) configured for the queue.

        ![](../_assets/trigger-example-status.png =700x){.border-yes}

        To assign an issue assignee when components change, add the condition **Components** → **became equal to** and specify the components.

        ![](../_assets/trigger-example-components.png =600x){.border-yes}

        {% note info "" %}

        A trigger with this condition will only fire if a single component is specified in the issue.

        {% endnote %}

    1. Make sure the logical operator **AND** is specified to the left of the condition group so that the trigger fires when all conditions are met simultaneously.
1. Set the trigger action:
    1. Add the action **Change field value**.
    1. Add the parameter **Assignee** → **Set value** and specify the employee who should be assigned as the assignee when the trigger fires.

        ![](../_assets/trigger-example-assignee.png =650x){.border-yes}

1. Save the trigger.

   To test the trigger, change the status or components of any issue in the queue where you set up the trigger.

## Automatically invite an issue assignee {#summon_ticket}

After completing a task, an employee might forget to specify important information, such as time spent. In this case, you can set up a trigger that will automatically invite the assignee if the issue is closed and no time spent is specified:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set conditions so that the trigger fires when an issue is closed if the **Time spent** field is empty:
    1. Add the condition **Status** → **became equal to** → **Closed**. Available statuses depend on the [workflow](https://yandex.ru/support/tracker/en/manager/workflow.md) configured for the queue.
    1. Add the condition **Time spent** → **Field value is empty**.
    1. Make sure the logical operator **AND** is specified to the left of the condition group so that the trigger fires when all conditions are met simultaneously.
1. Set the trigger actions:
    1. Add the action **Add comment to issue**.
    1. Click ![](../_assets/svg/icon-call.svg)</svg> **Invite** and select **Assignee**.
    1. Enter the comment text that the assignee should see and select the **Send as robot** option.
1. Click **Create trigger**.

    ![](../_assets/trigger-example-summon.png =800x){.border-yes}

When any issue is closed without time spent specified, the robot will create a comment and invite the assignee.

## Change issue status after creating a link {#new-link}

In many projects, issues depend on each other, even when different people are working on them. If an issue affects the completion of one or more other issues, it's important to notify colleagues about the problems that have arisen. For example, link such issues together and set the [link type](https://yandex.ru/support/tracker/en/user/ticket-links.md) **Blocking issue**.

Let's set up a trigger that will change the issue status and add a comment for the author if a **Blocking issue** link appears:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set conditions so that the trigger fires when a **Blocking issue** link appears:
    1. Add the condition **Link action** → **Link created** → **Blocking issue**.

    ![](../_assets/blocker-conditions.png =650x){.border-yes}

    1. Make sure the logical operator **AND** is specified to the left of the condition group so that the trigger fires when all conditions are met simultaneously.
1. Set the trigger actions:
    1. Add the action **Change issue status**.
    1. In the **Change issue status** field, select the status that will be set for the issue after the condition is met. For example, **Need info**. Available statuses depend on the [workflow](https://yandex.ru/support/tracker/en/manager/workflow.md) configured for the queue.

        <!-- source: en/_includes/create-trigger.md -->
        Note that the trigger won't work if you need to fill out any fields on the transition screen to reach the selected status. For more information, see [Transition settings](https://yandex.ru/support/tracker/en/manager/workflow-action-edit.md#set-transition). {#status-action}
        <!-- endsource: en/_includes/create-trigger.md -->

    1. Add the action **Add comment to issue**.
    1. Click ![](../_assets/svg/icon-call.svg)</svg> **Invite** and select **Author**.
    1. Enter the comment text that the issue author should see and select the **Send as robot** option. Otherwise, the comment will be sent on behalf of the user who triggered the action — the one who added the link.

    ![](../_assets/blocker-actions.png =800x){.border-yes}

1. Click **Create trigger**.


## Change issue status if a comment with specific text is added {#comment}

Let's set up a trigger that changes the issue status to **In progress** if a comment in the issue contains the fragments `Взял в работу` or `Взяла в работу` in any case:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Add the condition **Comment text** and select the [comparison operation](#comparison-operation) **Contains any of the fragments**.
1. Enter the text `Взял в работу` and press **Enter**. Then enter `Взяла в работу` and press **Enter**.
1. Enable the **Ignore case** option. Then the trigger will fire regardless of how the text fragment is written: with uppercase or lowercase letters.
1. Set the trigger action: in the list of actions, select **Change issue status** → **In progress**.

    <!-- source: en/_includes/create-trigger.md -->
    Note that the trigger won't work if you need to fill out any fields on the transition screen to reach the selected status. For more information, see [Transition settings](https://yandex.ru/support/tracker/en/manager/workflow-action-edit.md#set-transition). {#status-action}
    <!-- endsource: en/_includes/create-trigger.md -->

    ![](../_assets/trigger-example-comment.png =800x){.border-yes}

1. Click **Create trigger**.

## Automatically add issues to a board {#board}

On the [new version of the issue board](https://yandex.ru/support/tracker/en/manager/agile.md), you can set up automatic addition of issues by filter or trigger.

Instead of a trigger, you can also [set up an auto action](https://yandex.ru/support/tracker/en/user/create-autoaction.md) with similar conditions and actions. When using an auto action, issues matching the condition will be added to the board not immediately, but at a set interval.

{% note warning "" %}

Triggers and auto actions only work for issues in the queue where they are configured.

{% endnote %}

Let's consider an example of a trigger that adds an issue to a board when a specific user is assigned as the assignee:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set the condition: **Assignee** → **became equal to** → `<username>`.

   {% note info "" %}

   A trigger with this condition will also fire if a new issue is created with the specified assignee.

   {% endnote %}

1. Set the action:

    1. Select the action **Change field value**.
    1. Select the **Boards** field.
    1. Select the action **Add to list** and specify the board to which the issue should be added.

    ![](../_assets/trigger-example-board.png =700x){.border-yes}

1. Save the trigger.


## Automatically calculate the date difference {#tracker_data}

Let's set up a trigger to automatically calculate the difference between dates in Tracker:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Add the condition **Event** → **Formula fields changed**.

    ![](../_assets/create_trigger.png =480x){.border-yes}

1. Set the trigger actions:

    1. Add the value **Calculate value**.

    1. To get the date difference value expressed in days, in the **Formula for calculating value** field, specify:

        ```
        ({{issue.end.unixEpoch}}-{{issue.start.unixEpoch}})/86400000
        ```

    1. Select **Calculated field** from the [list](https://tracker.yandex.com/admin/fields).

        You can select a field from the standard ones or [create a new one](https://yandex.ru/support/tracker/en/user/create-param.md), for example, **Duration**:

        ![](../_assets/create_trigger_two.png =750x){.border-yes}

1. Click **Create trigger**.

    To test the trigger, change the values of the **Start date** and **End date** fields.

## Add the current date to a field {#today}

Let's consider an example of a trigger that sets the current date in the **Deadline** field if the priority changes to critical:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. For the trigger to fire when the issue priority changes, set the condition **Priority** → **became equal to** → **Critical**.

1. Set the trigger action:

    1. Add the action **Calculate value**.
    1. In the **Formula for calculation** field, specify `today()`.
    1. In the **Calculated field** field, select **Deadline**.

        ![](../_assets/trigger-example-deadline.png =800x){.border-yes}

1. Save the trigger.

   To test the trigger, change the priority to critical for any issue in the queue where you set up the trigger.

## Change issue priority when an SLA timer expires {#sla-excess}

If you have [configured SLA rules](https://yandex.ru/support/tracker/en/sla-head.md) for a queue, you can create a trigger that fires when a timer is exceeded.

Let's look at an example trigger that changes an issue's priority to "Critical" if the SLA timer is exceeded.

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Add the **SLA limit violation** condition.
1. Select a timer:
   - **Warning time** — when this time expires, Tracker sends a warning that the issue processing time is running out. This is an optional SLA parameter.
   - **Time to resolve** — the maximum time for processing an issue.
1. Enter the name of the rule you configured for the queue. For example, "Response time for request".
1. Set the trigger action:
    1. In the actions list, select **Change field value**.
    1. Add the **Priority** parameter and set the value to **Critical**.
1. Click **Create trigger**.

![](../_assets/trigger-example-sla.png =800x){.border-yes}

## Change issue status after completing a checklist {#checklist-done}

Let's look at an example trigger that moves an issue to the "Resolved" status if all [checklist items](https://yandex.ru/support/tracker/en/user/checklist.md) in the issue are completed:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Add the condition: **Checklist** → **All checklist items are completed**.
1. Next to the condition, enable the **Parameter changed** option. This ensures the trigger only fires when the last checklist item is marked as completed. The trigger won't fire when the issue is changed if all checklist items were completed earlier.
1. Set the trigger action: in the actions list, select **Change issue status** → **Resolved**.

    <!-- source: en/_includes/create-trigger.md -->
    Note that the trigger won't work if you need to fill out any fields on the transition screen to reach the selected status. For more information, see [Transition settings](https://yandex.ru/support/tracker/en/manager/workflow-action-edit.md#set-transition). {#status-action}
    <!-- endsource: en/_includes/create-trigger.md -->

1. Click **Create trigger**.

![](../_assets/trigger-example-checklist.png =800x){.border-yes}

## Close a parent issue after closing all subtasks {#sub-issues-done}

Let's look at an example trigger that moves a parent issue to the "Closed" status if all [subtasks](https://yandex.ru/support/tracker/en/user/ticket-links.md) are closed.

For the trigger to fire, the author of the subtask changes must have at least read permissions for the parent issue.


1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set conditions so the trigger fires when all subtasks are closed:
    1. Add the condition: **If** → **Related issue parameters**.
    1. Select the firing condition: **Related issues** → **All**.
    1. Add issue filter parameters: specify the link type **Subtask** and the status **Closed**.
    1. Add the condition: **Resolution** → **Field value is empty**, to avoid the trigger firing again when the subtask is modified.
    1. Make sure the logical operator **AND** is specified to the left of the condition group, so the trigger fires only when all conditions are met simultaneously.

    {% note warning "" %}

    It's not recommended to use the **Related issue parameters** and **Event** conditions simultaneously, as the trigger might not fire.

    {% endnote %}

1. Set the trigger actions to change the parent issue status and send a comment:
    1. In the actions list, select **Change field value**. Then add the **Resolution** parameter → **Set value** → **Resolved**.

    1. In the actions list, select **Change issue status** → **Closed**.

        <!-- source: en/_includes/create-trigger.md -->
        Note that the trigger won't work if you need to fill out any fields on the transition screen to reach the selected status. For more information, see [Transition settings](https://yandex.ru/support/tracker/en/manager/workflow-action-edit.md#set-transition). {#status-action}
        <!-- endsource: en/_includes/create-trigger.md -->


1. Click **Create trigger**.

![](../_assets/trigger-example-sub-issues-done.png =800x){.border-yes}

{% note warning "" %}

The trigger condition is checked asynchronously, so the parent issue status might be updated within a few minutes.

{% endnote %}

## Send a notification when an issue is created from an email {#notify_mail}

Let's assume that support staff register requests in Tracker. Users write to support via email, and issues are created in Tracker based on their emails.

Let's set up a trigger that will send the user an email notification that their request has been registered after the issue is created:

#### Step 1. Configure email integration

To send emails from Tracker and create issues from incoming emails, set up email integration:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. [Configure a mail address for the queue](https://yandex.ru/support/tracker/en/manager/queue-mail-other-service.md#get-mail) where issues for user requests will be created.


   If adding a queue address is unavailable, it means your organization doesn't have a domain. A domain is needed to create mailboxes and mailing lists, including creating a queue address. You can connect a domain for free [in the Yandex 360 for Business service](https://yandex.com/support/business/domains.html).


1. [Configure aliases and signatures](https://yandex.ru/support/tracker/en/manager/queue-mail-settings.md#edit-signature), if needed.


1. If the users are not employees of the organization:

    1. [Allow receiving emails from external mailboxes](https://yandex.ru/support/tracker/en/manager/queue-mail-settings.md#external-tasks).
    1. [Allow sending emails from issues to external addresses](https://yandex.ru/support/tracker/en/manager/queue-mail-settings.md#external-response).


#### Step 2. Set up a trigger to send emails

Set up a trigger that will send the user an email notification when a new issue is created from an incoming email:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set conditions so the trigger fires when a new issue is created from an incoming email:

    1. Add the condition **Event** → **Issue created**.

    1. Add the condition **Email** → **Created by email to address** → **Equals string** and enter the queue's mail address.

    1. Enable the **Ignore case** option in case the user enters the queue address with a capital letter.

    ![](../_assets/trigger-example-mail-condition.png =600x){.border-yes}

    1. Make sure the logical operator **AND** is specified to the left of the condition group, so the trigger fires only when all conditions are met simultaneously.

1. Set the trigger action to send an email:

    1. Select the action **Add comment to issue**.
    1. Enable the **Email** option.
    1. In the **To** field, add the variable with the address of the user who sent the request. To do this, select the **To** field, click **Variables**, and select **Email** → **From**.
    1. Write the email text. You can add [issue parameters](https://yandex.ru/support/tracker/en/user/vars.md) to the email using the **Variables** button.

    ![](../_assets/trigger-example-mail-action.png =650x){.border-yes}

1. Save the trigger.

    To test the trigger, send an email to the queue's mail address.

## Send a notification when an issue is created via a form {#notify_form}

Let's assume that support staff register requests in Tracker. Users contact support via a feedback form created in the [Yandex Forms](https://forms.yandex.com/cloud/admin) service. Issues are created in Tracker based on the completed form.

Let's set up a trigger that will send the user an email notification that their request has been registered after the issue is created:

#### Step 1. Configure email integration

To send emails from Tracker, set up email integration:

1. [Configure a mail address for the queue](https://yandex.ru/support/tracker/en/manager/queue-mail-other-service.md#get-mail) where issues for user requests will be created.


   If adding a queue address is unavailable, it means your organization doesn't have a domain. A domain is needed to create mailboxes and mailing lists, including creating a queue address. You can connect a domain for free [in the Yandex 360 for Business service](https://yandex.com/support/business/domains.html).


1. [Configure aliases and signatures](https://yandex.ru/support/tracker/en/manager/queue-mail-settings.md#edit-signature), if needed.

1. If the users are not employees of the organization, [allow sending emails from issues to external addresses](https://yandex.ru/support/tracker/en/manager/queue-mail-settings.md#external-response).

#### Step 2. Set up a form for registering requests

To create issues from requests via a form:

1. Go to the [Yandex Forms](https://forms.yandex.com/cloud/admin) service and create a new form.

1. Add questions to the form so the user can provide the information needed to register the request.

    To find out the user's email address, add a **Email** question and make it required.

    ![](../_assets/trigger-example-form-constructor.png =480x)

1. Configure [integration with Tracker](https://yandex.com/support/forms/create-task.html) for the form:

    1. Specify the queue and other issue parameters.

    1. In the **Issue description** field, add the answers to the form questions.

    1. To save the user's email address in the issue parameters, add the **From** field and select **Variables** → **Answer to question** → **Email**.

    1. Save the integration parameters.

    ![image](../_assets/trigger-example-form-integration.png =480x){.border-yes}

1. [Publish](https://yandex.com/support/forms/publish.html#section_link) the form.

#### Step 3. Set up a trigger to send emails

Set up a trigger that will send the user an email notification when a new issue is created via the form:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set conditions so the trigger fires when a new issue is created from an incoming email:

    1. Add the condition **Event** → **Issue created**.

    1. Add the condition **Email** → **From** → **Field value is set**.

    ![](../_assets/trigger-example-form-condition.png =480x){.border-yes}

    1. Make sure the logical operator **AND** is specified to the left of the condition group, so the trigger fires only when all conditions are met simultaneously.

1. Set the trigger action to send an email:

    1. Select the action **Add comment**.

    1. Enable the **Email** option.

    1. In the **To** field, add the variable with the address of the user who sent the request. To do this, select the **To** field, click **Add variable**, and select **Email** → **From**.

    1. Write the email text. You can add [issue parameters](https://yandex.ru/support/tracker/en/user/vars.md) to the email using the **Add variable** button.

    ![](../_assets/trigger-example-mail-action.png =650x){.border-yes}

1. Save the trigger.

    To test the trigger, fill out the form for which you configured integration with Tracker.


## Automatically add a form to issue comments {#insert_form}

You can use a trigger to add a form with pre-filled fields to an issue comment. To do this, add a special code with a link to the form in the comment text. You can pass values to the form fields via [GET parameters](https://yandex.com/support/forms/get-params.html). For example, you can pass issue parameters using [variables](https://yandex.ru/support/tracker/en/user/vars.md) available in the trigger.


Let's set up a trigger that will add a feedback form to comments and invite the assignee after the issue is closed:

#### Step 1. Create a feedback form

1. Go to [Yandex Forms](https://forms.yandex.com/cloud/admin) and create a form. 

1. Add questions to the form so the assignee can provide the necessary information.

#### Step 2. Create a trigger to add the form

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Set the conditions for the trigger to fire when the issue is closed: add the condition **Status** → **became equal to** → **Closed**.

    ![](../_assets/trigger-example-add-form-1.png =600x){.border-yes}

1. Add the **Add comment to issue** action.

1. Insert the following code into the comment text:

    ```
   /iframe/(src="https://forms.yandex.com/cloud/surveys/<form_ID>/?iframe=1&<question_ID>=<value>" frameborder=0 width=500)
    ```

    Where:
    - `<form_ID>` is the ID of the form to be added;

    - `<question_ID>` is the [question ID](https://yandex.com/support/forms/question-id.html#sec_question);

    - `<value>` is the value to be inserted into the form field.

      To pass issue parameters to the form, use [variables](https://yandex.ru/support/tracker/en/user/vars.md) as values: at the bottom of the window, click ![](../_assets/svg/variables.svg)</svg> **Variables** and select an issue parameter.

      For example, to pass the [issue key](*issuekey), use the value `{{issue.key}}`. To pass the issue assignee's login, use the value `{{issue.assignee.login}}`.

    Example code that passes the issue key to a form field:

     ```
    /iframe/(src="https://forms.yandex.com/cloud/surveys/68***/?iframe=1&answer_short_text_584943={{issue.key}}" frameborder=0 width=100% height=660px scrolling=no)
    ```

1. Click ![](../_assets/svg/icon-call.svg)</svg> **Invite** and select **Assignee**.

1. Enable the **Send on behalf of robot** option.


1. Click **Create trigger**.

#### Step 3. Add yndx-forms-cnt-robot@ to the queue

To insert the form correctly, grant the yndx-forms-cnt-robot@ robot access to the queue. For more information about setting up access, see [Configure queue access](https://yandex.ru/support/tracker/en/manager/queue-access.md).


![](../_assets/trigger-example-add-form-3.png =700x){.border-yes}


After the issue is closed, the robot will create a comment with the form and invite the assignee.

## Send notifications to messengers {#messengers}

Using messengers is convenient for quickly notifying employees about important events. If a messenger has an API, you can set up a trigger in Tracker that sends HTTP requests to the messenger's API when certain events occur. For example, when an error with a critical priority is created in a queue.

Examples of setting up triggers for sending notifications are provided in [Integration with messengers](https://yandex.ru/support/tracker/en/messenger.md).


## Create a subtask and write field values from the parent issue into it {#create-ticket-with-params}

Let's look at an example of a trigger that creates a subtask and populates its fields with values from the original issue. Using a trigger and the [Yandex Tracker API](https://yandex.ru/support/tracker/en/api-ref/about-api.md), you can configure automatic creation of such a task:

1. <!-- source: en/_includes/create-trigger.md -->
   On the queue settings page, go to **Automation** and click **Create** → **Trigger** in the top right corner. For more information, see [How do I set up a trigger?](https://yandex.ru/support/tracker/en/user/create-trigger.md). {#all-in-one}
   <!-- endsource: en/_includes/create-trigger.md -->

1. Select the [trigger conditions](https://yandex.ru/support/tracker/en/user/set-condition.md).
1. As the target action, select [**HTTP request**](https://yandex.ru/support/tracker/en/user/set-action.md#create-http).

1. Specify the request parameters. In the **Request body** field, specify the parameters of the subtask to be created. To insert values from the original issue, use [variables](https://yandex.ru/support/tracker/en/user/vars.md).

    {% cut "Example request parameters" %}

    #|
    || **Field** | **Content** ||
    || Method | POST ||
    || Address | `https://api.tracker.yandex.net/v3/issues` ||
    || Authentication method | OAuth 2.0 ||
    || Token | [Guide to obtaining a token](https://yandex.ru/support/tracker/en/api-ref/access.md#about_oauth) ||
    || Authorization header | Authorization ||
    || Token type | OAuth ||
    || Content type | application/json ||
    || Request body |

    >Example: create a subtask and pass fields from the original issue into it: description, assignee, followers, and tags.
    >
    >```json translate=no
    >{
    >    "summary": "My issue",
    >    "queue": "TEST",
    >    "description": {{issue.description.json}},
    >    "links": [
    >        {
    >            "relationship": "is subtask for",
    >            "issue": "{{issue.key}}"
    >        }
    >    ],
    >    "assignee": "{{issue.assignee.login}}",
    >    "tags": {{issue.tags.json}},
    >    "followers": {{issue.followers.uid.json}}
    >}
    >```
    More about the request: [Create issue](https://yandex.com/support/tracker/api-ref/issues/create-issue.html), [Link issues](https://yandex.com/support/tracker/api-ref/issues/link-issue.html). ||
    || Headers | Header: `X-Org-ID` or `X-Cloud-Org-ID`

    Value: Organization ID.

    <!-- source: en/api-ref/_includes/org-id.md -->
    To get the organization ID, go to **Administration** → [**Organizations**](https://tracker.yandex.com/admin/orgs) and copy the value from the **ID** field. {#find-id}
    <!-- endsource: en/api-ref/_includes/org-id.md -->

    ||
    |#

    {% endcut %}

    {% note info "" %}

    The parameters you pass in the request body using variables must be filled in the original issue. Otherwise, the trigger won't fire.

    {% endnote %}

1. Click **Create trigger**.

```

## Update status, priority, and add a comment in related issues {#update-related-tasks}

Let's look at an example of a trigger that updates the status, priority, and adds a comment in related issues. Using a trigger and the [Yandex Tracker API]({% if distr == 'on-prem' %}https://yandex.com/support/tracker/api-ref/about-api.html{% else %}../api-ref/about-api.md{% endif %}), you can configure automatic updates for related issues:

1. {% include [create-trigger](../_includes/create-trigger.md#all-in-one) %}

1. Select the [trigger conditions](../user/set-condition.md).

   {% note warning "" %}

   When setting up trigger conditions, pay attention to the possibility of a cascade call in related issues.

   {% endnote %}

1. For the target action, select [**HTTP request**](../user/set-action.md#create-http).

1. Specify the request parameters. In the **Request body** field, specify the update parameters for the related issues. To insert values from the source issue, use [variables](../user/vars.md).

    {% cut "Example request parameters" %}

     #|
    || **Field** | **Content** ||
    || Method | POST ||
    || Address | `https://api.tracker.yandex.net/v3/bulkchange/_transition` ||
    || Authentication method | OAuth 2.0 ||
    || Token | [Guide to obtaining a token]({% if distr == 'on-prem' %}https://yandex.com/support/tracker/api-ref/access.html{% else %}../api-ref/access.md{% endif %}#about_oauth) ||
    || Authorization header | Authorization ||
    || Token type | OAuth ||
    || Content type | application/json ||
    || Request body |

    >Example: update the status, priority, and add a comment in related issues.
    >
    >```json translate=no
    >{
    >    "transition": "need_info",
    >    "issues": "Relates: {{issue.key}}",
    >    "values": {
    >        "comment": "Comment text",
    >        "priority": {
    >            "key": "critical"
    >        }
    >    }
    >}
    >```
    Learn more about the request: [Bulk change issue status](https://yandex.com/support/tracker/api-ref/bulkchange/bulk-transition.html). ||
    {% if audience == "external" %}|| Headers | Header: `X-Org-ID`{% if distr == 'saas' %} or `X-Cloud-Org-ID`{% endif %}

    Value: Organization ID.

    {% include notitle [org-id](../api-ref/_includes/org-id.md#find-id) %}

    ||{% endif %}
    |#

    {% endcut %}

    {% note info "" %}

    If you only need to change field values in related issues without changing the status, use this request: [Bulk edit issues](https://yandex.com/support/tracker/api-ref/bulkchange/bulk-update-issues.html).

    The parameters you pass in the request body using variables must be filled in the source issue. Otherwise, the trigger won't fire.

    {% endnote %}

1. Click **Create trigger**.

## Create a subtask with the text of the user's last comment {#create-ticket-with-user-last-comment}

Let's look at an example of a trigger that automatically creates a subtask with the text of the user's last comment. Using a trigger and the [Yandex Tracker API]({% if distr == 'on-prem' %}https://yandex.com/support/tracker/api-ref/about-api.html{% else %}../api-ref/about-api.md{% endif %}), you can configure automatic creation of such an issue:

1. {% include [create-trigger](../_includes/create-trigger.md#all-in-one) %}

1. Under **Trigger conditions**, select **Last comment → Field value changed**.

1. For the target action, select [**HTTP request**](../user/set-action.md#create-http).

1. Specify the request parameters. In the **Request body** field, specify the parameters for the subtask to be created. To insert values from the source issue, use [variables](../user/vars.md#comment-variables).

    {% cut "Example request parameters" %}

    #|
    || **Field** | **Content** ||
    || Method | POST ||
    || Address | `https://api.tracker.yandex.net/v3/issues` ||
    || Authentication method | OAuth 2.0 ||
    || Token | [Guide to obtaining a token]({% if distr == 'on-prem' %}https://yandex.com/support/tracker/api-ref/access.html{% else %}../api-ref/access.md{% endif %}#about_oauth) ||
    || Authorization header | Authorization ||
    || Token type | OAuth ||
    || Content type | application/json ||
    || Request body |

    ```json translate=no
    {
        "queue": "QUEUE",
        "summary": "Subtask by comment",
        "description": "{{userComment.text}}",
        "parent": "{{issue.key}}"
    }
    ```
    **Parameter descriptions:**

    #|
    || **Parameter** | **Description** ||
    || `queue` | The key of the queue where the subtask will be created. ||
    || `summary` | The subtask summary. ||
    || `description` | The subtask description. The variable `{{userComment.text}}` is used here, which inserts the text of the user's last comment. ||
    || `parent` | The key of the parent issue. The variable `{{issue.key}}` inserts the key of the current issue. ||
    |#
    ||
    || Headers | Header: `X-Org-ID` or `X-Cloud-Org-ID`

    Value: Organization ID.

    <!-- source: en/api-ref/_includes/org-id.md -->
    To get the organization ID, go to **Administration** → [**Organizations**](https://tracker.yandex.com/admin/orgs) and copy the value from the **ID** field. {#find-id}
    <!-- endsource: en/api-ref/_includes/org-id.md -->

    ||
    |#

    {% endcut %}

2. Click **Create trigger**.

As a result, when a comment is added to an issue, a subtask will be automatically created in the specified queue, and its description will contain the text of the user's last comment from the ticket.

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

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

[*issuekey]: An issue key is a unique identifier contained in the issue link. It consists of the queue key and a number, for example `TEST-123`.