I have migrated from AzureDevOps to GitHub to manage my Scrum artifacts (Product and Sprint Backlogs) but I'm trying to simplify the usage with some automated actions.

I have settled on issues with a "Story" label that track issues with a "Task" label. However, when assigning a story or task to the sprint the iteration doesn't automatically get applied to the tasks. It makes it cumbersome to manage with things like the group by in the Sprint backlog view not working properly.

I know you can use issue based triggers and custom workflows/actions to manage labels etc. but I wonder how to implement one that sets the custom iteration field ("Sprint") on any tracked "Task" issues whenever it changes on the parent "Story" issue.

Pseudo code:

name: Inherit Sprint from Stories
on:
  issues:
    types:
      - edited
jobs:
  update_tasks:
    strategy:
      matrix:
        child_task: [${{ github.event.issue.tracks.issue.number }}]
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - run: gh issue edit "$NUMBER" --set-customfield "Sprint=$SPRINT"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GH_REPO: ${{ github.repository }}
          NUMBER: ${{ matrix.child_task }}
          SPRINT: ${{ github.event.issue.sprint }}

I think that gh CLI hasn't implemented setting custom fields yet and you need more complex coding via the API option but I had to ask. I'm also not sure what the GitHub variable would be to access the list of tracked issues. I think the tracks and tracked by fields are still in beta as well, so maybe this is a non-starter.

Reviewed the GitHub - Actions: Managing Issues and Pull Requests and the Github - Issues: About tracks and tracked by fields.

0

There are 0 best solutions below