1

I’m working on YouTrack Integration with GitHub.

My aim is to ensure that when a pull request is merged, the corresponding card moves from column “In Review” to column “Done”.

I’m currently trying to achieve it via action-youtrack-move

Workflow code is:

name: youtrack

on:
  pull_request:
    types: [closed]

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: bloobirds-it/action-youtrack-move@v1.0.0
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          yt-url: ${{ secrets.YOUTRACK_URL }}
          yt-token: ${{ secrets.YOUTRACK_TOKEN }}
          yt-project-id: "JSSAPI"
          yt-column-target: "Done"
          yt-column-triggers: "In Review"

But I get an error:

Run bloobirds-it/action-youtrack-move@v1.0.0
  with:
    github-token: ***
    yt-url: ***
    yt-token: ***
    yt-project-id: JSSAPI
    yt-column-target: Done
    yt-column-triggers: In Review
    yt-column-field: Stage
Checking /JSSAPI-[0-9]+/g against the PR description
TypeError: Cannot read property 'matchAll' of null
    at getMatchingTickets (/home/runner/work/_actions/bloobirds-it/action-youtrack-move/v1.0.0/dist/index.js:1003:35)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async run (/home/runner/work/_actions/bloobirds-it/action-youtrack-move/v1.0.0/dist/index.js:933:21)
Error: Cannot read property 'matchAll' of null

How can this problem be fixed? And, perhaps, you can suggest simpler and more efficient ways to achieve the goal I have indicated.

I reconnected the GitHub integration with the YouTrack project and it works correctly, i.e. the card displays the commits of the corresponding pull request.

I also checked all the tokens for validity, as well as the correctness of the links, although, based on the error message, this is not the case. The names of the columns, as far as I can see, are also entered correctly.

wilfordaf
  • 13
  • 2
  • Are you sure that [`yt-project-id`](https://github.com/bloobirds-it/action-youtrack-move#yt-project-id) used in your workflow is correct? It's an *Issue ID prefix used in the projects. Basically the letters before your tickets* – Abdul Niyas P M Nov 11 '22 at 09:18
  • Hello! As far as I understand, the project id is entered correctly, because the job is looking for cards (pool requests) with ids JSSAPI-[0-9]+, which is exactly how they are called on the board. I would love to post an image of the Agile board, but i don't have enough reputation :( – wilfordaf Nov 11 '22 at 09:25
  • It seems like the error is from [here](https://github.com/bloobirds-it/action-youtrack-move/blob/master/index.js#L104), because it cannot match pull request descriptions with id of the format `JSSAPI-[0-9]+` – Abdul Niyas P M Nov 11 '22 at 09:37
  • Oops, I'm sorry, I was a bit inattentive. The error in the execution of the job in the post was caused by closing the pull request with the addition of a workflow (for which there was no card). When the correct pull request is closed, the job is executed successfully, but it does not move the card, although the card JSSAPI-4 is in the "In Review" column. Job message: `Checking /JSSAPI-[0-9]+/g against the PR description Found issues: JSSAPI-4. (Skipping) JSSAPI-4 not found in column triggers` – wilfordaf Nov 11 '22 at 10:20

1 Answers1

1

Wouldn't it be easier to use commands in merge requests? Use "#Issue-ID Done" in the comment, and the issue's state should be changed.