---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.0
  - property: og:type
    content: article
  - property: article:section
    content: Examples of workflow setup
  - property: og:title
    content: Setting up automatic issue creation
  - property: article:tag
    content: Technical instructions
alternate:
  - https://yandex.ru/support/tracker/en/hr-process-employment-queue.md
  - https://yandex.ru/support/tracker/ru/hr-process-employment-queue.md
  - href: https://yandex.ru/support/tracker/en/hr-process-employment-queue.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.ru/support/tracker/en/llms.txt?revision=r22105730
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/tracker/en/llms.txt?revision=r22105730


# Setting up automatic issue creation

To manage the workflows for official employment and onboarding of new employees, create a queue where you will track procedural matters, provision of equipment and access permissions, and the progress of probation period. Automate the creation of an appropriate issue pool when the candidate issue is closed with the **Hired** resolution.

## Create a queue for new employees {#create-employment-queue}

1. [Create a queue](https://yandex.ru/support/tracker/en/manager/create-queue.md) using the **HR processes** template.
1. For example, `Employment Queue`.
1. Set up a workflow or create a [new](https://yandex.ru/support/tracker/en/manager/workflow.md) one if needed.
1. For the workflow, specify the default [issue type](https://yandex.ru/support/tracker/en/manager/add-ticket-type.md), for example `Новые сотрудники`.
1. Set up [queue access permissions](https://yandex.ru/support/tracker/en/manager/queue-access.md) to protect employee personal data.

## Add issue types {#add-ticket-types}

Create separate issue types for various procedures related to employment and onboarding of new employees. For example, to issue access permissions and equipment, create an issue type `Доступы и оборудование`:

1. Click ![](_assets/svg/settings.svg)</svg> **Queue settings** in the top right corner of the `Employment Queue` page.
1. In the left panel, select **Workflows**.
1. Click ![](_assets/svg/add-icon.svg)</svg> **Add issue type** and select an issue type from the list.
1. To add a resolution, such as **Resolved**, hover over the issue type line and click ![](_assets/svg/add-icon.svg)</svg>.

{% note warning "" %}

Only an administrator can create new issue types. Make sure the issue types are unique.

{% endnote %}

## Set up a trigger in the Candidates Queue {#trigger-for-candidates-queue}

To automate replication of issues from the `Candidates Queue` to the `Employment Queue`, create a trigger that will fire when the candidate issue status changes to **Hired**:

1. Click ![](_assets/svg/settings.svg)</svg> **Queue settings** in the top right corner of the `Candidates Queue` page.
1. Select **Automation** in the left-hand panel.
1. In the top right corner, click **Create** → **Trigger**.
1. Enter the trigger name, for example `Кандидат принят`.
1. In the ![](_assets/svg/filter-icon-for-autoaction.svg) **Under condition** section, specify **Status** → **became equal to** → **Hired** (the status you created in the Candidates Queue workflow). Read more about trigger conditions [here](https://yandex.ru/support/tracker/en/user/set-condition.md).
1. Under ![](_assets/svg/arrow-icon-for-autoaction.svg) **Perform actions**, select **HTTP request**.

    ![](_assets/hr-process-employment-queue.png =700x){.border-yes}

1. In the form that opens, enter 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](https://yandex.ru/support/tracker/en/user/vars.md):

    #|
    || **Field** | **Content** ||
    || Method | POST ||
    || Address | `https://api.tracker.yandex.net/v3/issues` ||
    || Authorization method | OAuth 2.0 ||
    || Token | `<OAuth-токен>` (see [Guide to getting a token](https://yandex.ru/support/tracker/en/api/access.md#about_OAuth)) ||
    || Authorization header | Authorization ||
    || Token type | OAuth ||
    || Content type | application/json ||
    || Request body |
    >```json
    >{
    >    "queue": "<Employment_Queue_key>",
    >    "summary": {{issue.summary.json}},
    >    "description": {{issue.description.json}},
    >    "type": "<New_Employees_issue_key>",
    >    "parent": "{{issue.key}}"
    >}
    >```
    ||
    || Headers | Header: `X-Org-ID` or `X-Cloud-Org-ID`

    Value: Organization ID.

    <!-- source: en/api/_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.
    <!-- endsource: en/api/_includes/org-id.md -->

    ||
    |#

    {% note info "" %}

    The parameters that you pass in the request body using variables must be filled in in the original issue, otherwise the trigger will not fire.

    {% endnote %}

1. To save the trigger, click **Create**.


## Set up a trigger in the Employment Queue {#trigger-for-employment-queue}

After the candidate's issue is copied to the employees queue `Employment Queue`, you need to create several sub-issues related to the new employee in the same queue, for example: `Доступы и оборудование`, `Оформление документов`, `Испытательный срок`. To automate sub-issue creation, create a trigger that will fire when the new employee's issue status changes to **In progress**. To make the trigger fire only for issues of type `Новые сотрудники`, specify this type in the trigger conditions.

### Create a trigger {#create-trigger}

1. Click ![](_assets/svg/settings.svg)</svg> **Queue settings** in the top right corner of the `Employment Queue` page.
1. Select **Automation** in the left-hand panel.
1. In the top right corner, click **Create** → **Trigger**.
1. Enter the trigger name, for example `Новый сотрудник`.
1. In the ![](_assets/svg/filter-icon-for-autoaction.svg) **Under condition** section, set two conditions:
    * **Status** → **became equal to** → **In progress** (the status you created in the Candidates Queue workflow).
    * **Type** → **is equal to** → **New employee** (the issue type you created in the Candidates Queue workflow).
        Read more about trigger conditions [here](https://yandex.ru/support/tracker/en/user/set-condition.md).
1. Under ![](_assets/svg/arrow-icon-for-autoaction.svg) **Perform actions**, select **HTTP request**.
1. In the form that opens, enter the request parameters as you did earlier. In the **Request body** field, update the issue `type` `description` and key, for example:

```json
{
    "queue": "<Employment_Queue_key>",
    "summary": {{issue.summary.json}},
    "description": "Выдать доступы и оборудование",
    "type": "<issue_key_Access_permissions_and_equipment>",
    "parent": "{{issue.key}}"
}
```

### Add actions {#add-actions}

To automatically create other sub-issues, add the appropriate actions to the trigger:

1. Under ![](_assets/svg/arrow-icon-for-autoaction.svg) **Perform actions**, select **HTTP request**.
1. Fill out the form as you did earlier. In the **Request body** field, update the issue type description and key, for example:

    ```json
    {
        "queue":"<Employment_Queue_key>",
        "summary":{{issue.summary.json}},
        "description":"Probation period",
        "type":"<Probation_Period_issue_type_key>",
        "parent":"{{issue.key}}"
    }
    ```

1. Repeat the steps to add actions for other issues.
1. To save the trigger, click **Create**.

## Test the triggers {#check-trigger}

1. On the `Candidate Queue` page, select the test issue and change the status to **Hired**.
1. Make sure a new issue has appeared on the `Employment Queue` page.
1. Open the issue and select **In progress** in the status field.
1. Make sure the queue now contains all the appropriate sub-issues.

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

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