Automating standing modifications on the Yandex Tracker board with Yandex-tracker-action by Evrone


Yandex Tracker is much like Jira service, in that it’s used for collaborating on tasks and managing processes inside an organization. Firms use Yandex Tracker to construction and implement tasks, corresponding to creating apps, operating advert campaigns, processing consumer requests, approving contracts, and extra. Yandex Tracker allows managers to distribute work amongst staff members and monitor their progress, and it additionally helps workers preserve monitor of their duties, deadlines, and priorities.

In the intervening time, Yandex Tracker cannot robotically transfer duties across the board, so you must transfer duties your self, which isn’t at all times handy. For instance, a developer can push a commit and open a pull request, however then they must go to Yandex Tracker and manually change that activity’s standing to, for instance, “For Evaluate”. 

Evrone has a staff engaged on an inner ERP mission, and so they began to surprise if this course of could possibly be automated. The primary concept that got here to thoughts to unravel this downside was to jot down an motion within the Github pipeline, since, in the intervening time, there aren’t any options to this Github motion. Yandex Tracker has an API which you’ll ship requests to, like, “Transfer the duty to a different state”. 

So that is what Yandex-tracker-action does. No magic — it simply communicates with the Yandex API underneath the hood and strikes the duty. Now after we open a pull request, we’ve got an motion operating that strikes the duty. After we shut the pull request and merge it, the duty additionally strikes to the “Merged” standing.

 

How does Yandex-tracker-action work?

By default, it parses commits of the shape “[RI-1] implement one thing” and takes the duty quantity, which on this case is RI-1. You may as well set duties instantly within the motion, for instance, by specifying the output from the earlier job.

If there are a number of commits with completely different activity keys within the pull request, they’ll all be moved on the board. It’s also potential to specify a number of duties in an motion. All activity keys will likely be collected, each specified within the motion and located within the commits.

If the duty key isn’t discovered within the tracker, you’ll obtain a warning, however the duties discovered will likely be processed. If the duty has nowhere to maneuver or it’s already within the desired standing, a message will likely be displayed.

Fundamental utilization

By default, commit messages corresponding to “[RI-1] awesome-feature” will likely be parsed, the place “RI-1” would be the characteristic key. You may specify a particular activity key, and you can even use the logic from the earlier job step.

title: YC Tracker
on:
  pull_request:
    varieties:
      - opened
      - reopened
      - synchronize
      - closed

jobs:
 transit-tasks:
    runs-on: ubuntu-latest
    steps:

      - title: Checkout
        makes use of: actions/checkout@v3
        with:
          ref: ${{ github.occasion.pull_request.head.sha }}

      - title: Transfer Process When PR Opened
        if: github.occasion.motion != 'closed'
        makes use of: evrone-erp/yandex-tracker-action@v1
        with:
          token: ${{secrets and techniques.GITHUB_TOKEN}}
          yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
          yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
          task_url: true
          ignore: ERP-31,ERP-32

      - title: Transfer Process When PR Merged
        if: github.occasion.pull_request.merged == true
        makes use of: evrone-erp/yandex-tracker-action@v1
        with:
          token: ${{secrets and techniques.GITHUB_TOKEN}}
          yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
          yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
          task_url: true
          ignore: ERP-31,ERP-32

Add particular activity key

You may specify activity numbers, separated by commas.

- makes use of: evrone-erp/yandex-tracker-action@v1
  with:
    token: ${{secrets and techniques.GITHUB_TOKEN}}
    yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
    yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
    duties: RI-218 # or RI-218,RI-11

Add ignore duties

You might must ignore some long-lifecycle duties. In case you have long-running duties that you don’t want to robotically transfer, then you may ignore them. A number of duties ought to be separated by commas.

- makes use of: evrone-erp/yandex-tracker-action@v1
  with:
    token: ${{secrets and techniques.GITHUB_TOKEN}}
    yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
    yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
    ignore: RI-1 # or RI-1,DI-8

Remark PR with activity url

If true — a remark will likely be set to the present PR with the duty tackle of the type within the PR description.

- makes use of: evrone-erp/yandex-tracker-action@v1
  with:
    token: ${{secrets and techniques.GITHUB_TOKEN}}
    yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
    yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
    task_url: true

Get all accessible transitions

By default, if the PR is open, the duty will go into the in_review state. If the PRs are merged, the state is resolve. You may specify a human readable title or endpoint title.

Get all accessible states:

curl -H "Authorization: OAuth <oauth2-token>" -H "X-Org-ID: <org-id>" -H "Content material-Sort: utility/json" https://api.tracker.yandex.web/v2/points/<task-key>/transitions | jq ".[].id"

See output of the motion and discover states:

- makes use of: evrone-erp/yandex-tracker-action@v1
  with:
    token: ${{secrets and techniques.GITHUB_TOKEN}}
    yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
    yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
    to: 'На ревью' # or 'in_review'

One transfer if PR is opened and one transfer whether it is merged

You may transfer a difficulty when opening a PR and when merging a PR into completely different transitions. See default state names above.

- title: Transfer Process When PR Opened
  if: github.occasion.motion != 'closed'
  makes use of: evrone-erp/yandex-tracker-action@v1
  with:
    token: ${{secrets and techniques.GITHUB_TOKEN}}
    yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
    yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
    to: 'in_review'

- title: Transfer Process When PR Merged
  if: github.occasion.pull_request.merged == true
  makes use of: evrone-erp/yandex-tracker-action@v1
  with:
    token: ${{secrets and techniques.GITHUB_TOKEN}}
    yandex_org_id: ${{ secrets and techniques.YANDEX_ORG_ID }}
    yandex_oauth2_token: ${{ secrets and techniques.YANDEX_OAUTH2_TOKEN }}
    to: 'merged'

Future plans

The event of Yandex-tracker-action started fairly lately and remains to be in progress, however we’d in the end like to incorporate further choices that different corporations may have. Subsequently, within the close to future, we plan to launch a brand new implementation and use the Yandex-tracker-action on shopper tasks.

Every firm has its personal enterprise processes, and the actions ought to be tailor-made for every enterprise’s desired statuses. For instance, after we open a pull request, we transfer the duty to the “For Evaluate” state, however maybe one other firm has this course of constructed in a different way and so they transfer the duty to a special subject. 

We plan to offer for such instances within the new implementation and make it in order that the consumer can specify, for instance, a number of transitions between statuses. Wherein case, our motion will look to see if it may possibly transfer the duty to the primary standing, or if it may possibly transfer to the second, and so forth. If it may possibly’t transfer the duty to any of the listed statuses, it would merely show a listing of obtainable transitions.

In case you’re in search of a device to automate your corporation processes, we can assist you develop a helpful answer — in Yandex or in one other services or products. Simply ship us a message utilizing the shape under, and we’ll contact you to debate the main points and see how we will associate with you to develop a helpful mission collectively.



Latest articles

Related articles

Leave a reply

Please enter your comment!
Please enter your name here