Trigger use cases in Tracker

Picking assignees automatically

It might often be the case that different employees are assigned to perform specific work stages. When an employee has completed their part of the work, they hand over the issue to the next assignee. In Tracker, each issue stage has its own status. When the issue switches over to a certain status, you can use a trigger to automatically set the assignee for the next work stage.

Another way to organize the workflow is to make certain employees responsible for certain types of tasks. For example, each support employee is responsible for queries related to a particular product. To manage this kind of workflow, you can configure components that correspond to specific products. When a product's component is added to an issue, you can use a trigger to automatically assign it to the employee responsible for that product.

Let's set up a trigger to automatically assign the issue:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set the trigger to fire when the issue's Status or Components change:

    1. Add the condition Event typeIssue changed.

    2. To assign a new assignee after the status changes, add the following condition: Statusbecame equal to and specify the status. The available statuses depend on the workflow set up for the queue.

      To assign a new assignee after a component changes, add the following condition: Componentsbecame equal to and specify the components.

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

    3. Be sure to put the AND logical operator to the left of the condition group for the trigger to fire if the conditions are met at the same time.

  3. Set the action for the trigger:

    1. Add the Update fields action.

    2. Add the AssigneeSet value parameter and specify who should be specified as the assignee when the trigger fires.

  4. Save your trigger.

    To check the trigger operation, change the status or components for any issue from the queue that you set up the trigger for.

Summoning assignees automatically

Having completed the issue, the employee might forget to specify some important information, for example, the time spent. In this case, you can set up a trigger that will automatically summon the user if the issue was closed, but the time spent was not specified.

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set the trigger to fire on closing the issue in case the Time spent field is empty:

    1. Add the condition Status → Field value became equal toClosed. The available statuses depend on the workflow set up for the queue.
    2. Add the condition Time SpentField value is empty.
    3. Be sure to put the AND logical operator to the left of the condition group for the trigger to fire if the conditions are met at the same time.
  3. Set the actions for the trigger:

    1. Add the Add comment to issue action.
    2. Click  Invite and select Assignee.
    3. Enter the comment to be displayed to the issue assignee and choose Send as robot.
  4. Click Create trigger.

Whenever an issue is closed without specifying the time spent, the robot will create a comment and summon the assignee.

In many projects, issues depend on each other even if different people are working on them. If an issue affects the progress of one or more other issues, it is important to notify other team members if any problems arise. For example, you can link such issues to each other and set the link type Blocking issue.

Let's set up a trigger that will change an issue's status and add a comment for its reporter when the Blocking issue to link is added:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set the trigger to fire when the Blocking issue to link appears:

    1. Add the following condition: Action with linkLink createdBlocking issue.

    1. Be sure to put the AND logical operator to the left of the condition group for the trigger to fire if the conditions are met at the same time.
  3. Set the actions for the trigger:

    1. Add the Change issue status action.

    2. In the Change issue status field, select the status to switch the issue to when the condition is met, For example, Need info. The available statuses depend on the workflow set up for the queue.

      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.

    3. Add the Add comment to issue action.

    4. Click  Invite and select Author.

    5. Enter the comment to be displayed to the issue author and choose Send as robot. Otherwise, the comment is sent on behalf of the user who initiates the trigger action by adding the link.

  4. Click Create trigger.

Changing the issue status when a comment containing the specified text is added

Let's set up a trigger that changes the issue status to In progress if a comment added to the issue contains the text In progress or Underway, regardless of case:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Add the Comment text condition and select the comparison operation Contains any of the fragments.

  3. Enter In progress and press Enter. Then enter Underway and press Enter.

  4. Enable the Ignore case option. The trigger will fire whether the text fragment is in uppercase or lowercase.

  5. Set the trigger action: in the list of actions, select Change issue status → In progress.

    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.

  6. Click Create trigger.

Automatically adding issues to your board

The new board version allows you to set up adding issues automatically by a filter or trigger.

Instead of a trigger, you can also set up an auto action with a similar condition and action. When using an auto action, the issues meeting the condition will be added to the board at the specified time intervals rather than immediately.

Triggers and auto actions only work for issues from the queue where they have been set up.

Here is an example of a trigger that will add an issue to the board when it is assigned to a certain user:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set the condition: Assigneebecame equal to<username>.

    The trigger with this condition will also fire when an issue is created with the specified assignee.

  3. Set up the action:

    1. Select the Change field value action.
    2. Select the Boards field.
    3. Select the Add to list action and specify the board to add an issue to.

  4. Save your trigger.

Automatically calculating the difference between dates

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

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Add the condition EventFormula fields changed.

  3. Set the actions for the trigger:

    1. Add the Calculate value value.

    2. To get the difference of dates, in days, specify the following in the Formula for automatic calculation field:

      ({{issue.end.unixEpoch}}-{{issue.start.unixEpoch}})/86400000
      
    3. Select Field for calculation from the list.

      You can select one of the standard fields or create a new one, such as Duration:

  4. Click Create trigger.

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

Adding the current date to the field

Let's say you want to set up a trigger that inserts the current date into the Deadline field when the priority changes to critical:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. For the trigger to fire in response to issue priority changes, set the condition Prioritybecame equalCritical.

  3. Set the action for the trigger:

    1. Add a Calculate value action.

    2. In the Calculation formula field, specify today().

    3. In the Field for calculation field, choose Deadline.

  4. Save your trigger.

    To test the trigger, change the priority to critical for any issue in the queue where you've configured the trigger.

Changing the issue priority when the SLA timer triggers

If the queue has SLA rules set up, you can create a trigger that fires when the timer runs out.

Let's examine an example of a trigger that changes the issue's priority to Critical if the SLA timer expires.

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Add the SLA limit violation condition.

  3. Select a timer:

    • Violation of warning time: When this time expires, Yandex Tracker sends a warning that the time to process the issue is running out. This is an optional SLA parameter.
    • Violation of completion time: Time limit for processing the issue.
  4. Enter the name of the rule that you set up for the queue. For example, "Request response time".

  5. Set the action for the trigger:

    1. In the list of actions, select Change field value.
    2. Add the Priority parameter and set the value to Critical.
  6. Click Create trigger.

Changing the issue status when the checklist is completed

Let's examine an example of a trigger that changes the issue to the Resolved status if all items on the issue's checklist are completed:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Add a condition: ChecklistAll checklist items are completed.

  3. Next to the condition, enable the Parameter changed option. Then the trigger will only fire when you check off the final item in the checklist. The trigger won't fire when you update the issue if all the checklist items were completed earlier.

  4. Set the trigger action: in the list of actions, select Change issue status → Resolved.

    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.

  5. Click Create trigger.

Sending a notification when an issue is created from an email

Let's say the support team is processing user requests in Tracker. Users contact the support team via email, and those emails are used as the basis for issues in Tracker.

Let's set up a trigger that, once the issue is created, sends to the user an email that their request has been registered.

Step 1. Set up email integration

You need to set up email integration if you want to send emails right from Tracker and create issues from incoming emails:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set up an email address for the queue to store issues created based on user requests.

    If you cannot add an address for the queue, it means that your organization does not have a domain. You need a domain to create mailboxes and newsletters, for example, to add an email address for your queue. You can add a domain in Yandex 360 for Business free of charge.

  3. Set up sender names and signatures if needed.

  4. If the users are not your company employees:

    1. Allow receiving emails from external addresses.
    2. Allow sending emails from issue pages to external addresses.

Step 2. Setting up a trigger for sending emails

Set up a trigger that, whenever an issue created based on an email, will notify the user via email:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set up the conditions to fire the trigger when an issue is created based on an incoming email:

    1. Add the condition Event typeIssue created.

    2. Add the condition EmailCreated by email toEquals string and enter the email address to your queue.

    3. Enable Ignore case so that the queue address isn't case sensitive.

    1. Be sure to put the AND logical operator to the left of the condition group for the trigger to fire if the conditions are met at the same time.
  3. As a trigger action, set up sending an email:

    1. Select the Add comment to issue action.
    2. Enable the Email option.
    3. In the To field, add the variable with the address of the user who sent the request. To do this, select the Email To field, click Variables, and choose EmailEmail From.
    4. Write the text of your message. You can add issue parameters to your message by clicking Variables.

  4. Save your trigger.

    To see if the trigger works, send an email to the queue address.

Sending a notification when an issue is created based on a form

Let's say the support team is processing user requests in Tracker. Users contact the support team via a feedback form created in Yandex Forms. A Tracker issue is then created based on that form.

Let's set up a trigger that, once the issue is created, sends to the user an email that their request has been registered.

Step 1. Set up email integration

You need to set up email integration if you want to send emails from Tracker:

  1. Set up an email address for the queue to store issues created based on user requests.

    If you cannot add an address for the queue, it means that your organization does not have a domain. You need a domain to create mailboxes and newsletters, for example, to add an email address for your queue. You can add a domain in Yandex 360 for Business free of charge.

  2. Set up sender names and signatures if needed.

  3. If the users are not your company employees, allow sending emails from issue pages to external addresses.

Step 2. Set up a form to register requests

To create issues based on requests submitted from a form:

  1. Go to Yandex Forms and create a new form.

  2. Add questions that allow users to provide relevant information that is required to register their request.

    If you want to know the user email address, add the Email question and make it a required field.

  3. Set up integration with Tracker for the form:

    1. Specify the queue and other issue parameters.

    2. Use the Issue description field to add answers to the questions included in your form.

    3. To save the user's email address in the issue settings, add the From field and select VariablesAnswer to questionEmail.

    4. Save your integration settings.

    image

  4. Publish the form.

Step 3. Setting up a trigger for sending emails

Set up a trigger that, whenever an issue created from a form, will notify the user via email:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set up the conditions to fire the trigger when an issue is created based on an incoming email:

    1. Add the condition Event typeIssue created.

    2. Add the condition EmailFromField value became not empty.

    1. Be sure to put the AND logical operator to the left of the condition group for the trigger to fire if the conditions are met at the same time.
  3. As a trigger action, set up sending an email:

    1. Choose the Add comment action.

    2. Enable the Email option.

    3. In the To field, add the variable with the address of the user who sent the request. To do this, select the Email To field, click Add variable, and choose EmailEmail From.

    4. Write the text of your message. You can add issue fields to your message by clicking Add variable.

  4. Save your trigger.

    To see if your trigger works, fill out the form you integrated with Tracker.

Automatically adding a form to the issue comments

You can choose a trigger to add a form with pre-populated fields to the issue comments. For this, add, as the comment text, a special code including a link to the form. Values can be passed to the form fields via GET parameters. For example, you can pass the issue's parameters using the variables available in the trigger.

Let's set up a trigger that, whenever an issue is closed, will add a feedback form to the comments and invite the assignee to comment.

Step 1. Creating a feedback form

  1. Go to Yandex Forms and create a form. to find out which admin panel you can use to create forms.

  2. Add questions so that users could provide the required information.

Step 2. Creating a trigger for adding a form

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Set the conditions so that the trigger fires when the issue is closed: add the Statusbecame equal toClosed condition.

  3. Add the Add comment to issue action.

  4. Use the following code as the comment's text:

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

    Where:

    • <form_ID>: ID of the form to add.

    • <question_id>: Question ID.

    • <value>: Value to use in the form field.

      To send issue parameters to the form, use variables as values: click  Variables at the bottom of the window and choose the issue parameter.

      For example, to provide the issue key, use the not_var{{issue.key}} value. To provide the assignee login, use the not_var{{issue.assignee.login}} value.

    Here is an example of the code where the issue key is provided to a field of the form.

    /iframe/(src="https://forms.yandex.ru/surveys/68***/?iframe=1&answer_short_text_584943=not_var{{issue.key}}" frameborder=0 width=100% height=660px scrolling=no)
    
  5. Click  Invite and select Assignee.

  6. Enable Send as robot.

  7. Click Create trigger.

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

To embed the form correctly, grant the yndx-forms-cnt-robot@ robot access to the queue. To learn more about setting up access, see Setting access rights for queues.

When the issue is closed, the robot will create a comment with a form and summon the assignee.

Sending notifications to instant messengers

By using messengers, you can quickly notify your employees about important events. If a messenger has an API, you can use Tracker to set up a trigger that sends HTTP requests to the messenger API when certain events occur. For example, this might be handy when a severe error occurs in your queue.

To view examples for setting up triggers that send notifications, see Integration with messengers.

Creating a sub-issue and writing field values from its parent issue to it

As an example, let's assume we need a trigger that creates a sub-issue and fills out its fields with values from the original issue. You can set up auto creation of issues like this using a trigger and Yandex Tracker API:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Select trigger conditions.

  3. Select HTTP request as a target action.

  4. Specify the request parameters. In the Request body field, set the parameters of a new sub-issue. To substitute the values from the original issue, use variables.

    Examples of request parameters

    Field

    Content

    Method

    POST

    Address

    https://api.tracker.yandex.net/v3/issues

    Authorization method

    OAuth 2.0

    Token

    How to get a token

    Authorization header

    Authorization

    Token type

    OAuth

    Content type

    application/json

    Request body

    Example: Creating a sub-issue and transmitting to it field values from the original issue, such as description, assignee, followers, and tags.

    {
       "summary": "<issue_name>",
       "queue": "<queue_key>",
       "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}}
    }
    

    For more information about the request, see Creating an issue and Linking issues.

    Headers

    Header: X-Org-ID.
    Value: Organization ID. To look up the ID, go to AdministrationOrganizations (the ID field).

    Make sure the parameters you pass in the request body using variables are set in the original issue; otherwise, the trigger will not fire.

  5. Click Create trigger.

For example, we have a trigger that updates the status, priority, and adds a comment in related issues. Using a trigger and Yandex Tracker API, you can configure automatic update of related issues:

  1. On the queue settings page, go to Automation and click CreateTrigger in the top right corner. For more information, see Setting up a trigger in Tracker.

  2. Select trigger conditions.

    When creating a trigger condition, pay attention to the possibility of a cascading call in related issues.

  3. Select HTTP request as a target action.

  4. Specify the request parameters. In the Request body field, specify the update parameters in related issues. To substitute the values from the original issue, use variables.

    Examples of request parameters

    Field

    Content

    Method

    POST

    Address

    https://api.tracker.yandex.net/v3/bulkchange/_transition

    Authorization method

    OAuth 2.0

    Token

    How to get a token

    Authorization header

    Authorization

    Token type

    OAuth

    Content type

    application/json

    Request body

    Example: Updating status, priority and adding a comment in related issues.

    {
       "transition": "need_info",
       "issues": "Relates: {{issue.key}}",
       "values": {
           "comment": "<Comment for related issues>",
           "priority": {
               "key": "critical"
           }
       }
    }
    

    For more information about the request, see Bulk changes to issue statuses.

    Headers

    Header: X-Org-ID.
    Value: Organization ID. To look up the ID, go to AdministrationOrganizations (the ID field).

    If you need to change only field values in the related issues without changing the status, use the request: Bulk changes to issues.

    Make sure the parameters you pass in the request body using variables are set in the original issue; otherwise, the trigger will not fire.

  5. Click Create trigger.