Skip to content

add support for iteration field types#76

Merged
EndBug merged 3 commits into
EndBug:mainfrom
kjswartz:ks/add-iteration-support
Dec 23, 2024
Merged

add support for iteration field types#76
EndBug merged 3 commits into
EndBug:mainfrom
kjswartz:ks/add-iteration-support

Conversation

@kjswartz
Copy link
Copy Markdown
Contributor

@kjswartz kjswartz commented Dec 12, 2024

Description

  • Add iteration types
  • Update the graphql queries to return iteration field values and the iteration ids for setting new values
  • this update will allow the user to set completedIterations in addition to the current and future iteration values available.
  • resolves issue#54

Testing

I created a release in my fork pointing to my branch so action could be tested. You will need to setup a projectV2 with an iteration field type. Then create an issue and add it to the project. Here is an example workflow testing set, clear and get.

To test setting a completedIteration setup an iteration for dates in the past and then verify the iteration value is in the completed filter view for iterations. Then you can pass the value and verify it is set in the project board.

name: Update Project iteration field

on:
  issues:
    types: [closed, reopened]

jobs:
  update-project-field:
    name: Update Project Iteration field
    runs-on: ubuntu-latest
    steps:
      - name: Set project iteration field on close
        if: github.event.action == 'closed'
        uses: kjswartz/project-fields/@v1.0.0
        with:
          operation: set
          fields: '<ITERATION FIELD>'
          github_token: ${{ secrets.GITHUB_TOKEN }}
          project_url: 'https://github.com/orgs/<ORG>/projects/<NUMBER>'
          resource_url: 'https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}'
          values: <VALID_VALUE>

      - name: Clear project iteration field on reopen
        if: github.event.action == 'reopened'
        uses: kjswartz/project-fields/@v1.0.0
        with:
          operation: clear
          fields: '<ITERATION FIELD>'
          github_token: ${{ secrets.GITHUB_TOKEN }}
          project_url: 'https://github.com/orgs/<ORG>/projects/<NUMBER>'
          resource_url: 'https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}'
          
      - name: get project iteration field
        uses: kjswartz/project-fields/@v1.0.0
        id: get-field
        with:
          operation: get
          fields: '<ITERATION FIELD>'
          github_token: ${{ secrets.GITHUB_TOKEN }}
          project_url: 'https://github.com/orgs/<ORG>/projects/<NUMBER>'
          resource_url: 'https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}'
        
      - name: write output
        run: echo ${{ steps.get-field.outputs.values }}

Copy link
Copy Markdown
Owner

@EndBug EndBug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice! I've tested this now and it seems to work well :)
I'm going to merge and release now so we can close this for good

@EndBug EndBug merged commit 679e371 into EndBug:main Dec 23, 2024
@EndBug
Copy link
Copy Markdown
Owner

EndBug commented Dec 23, 2024

@all-contributors please add @kjswartz for their dev contribution

@allcontributors
Copy link
Copy Markdown
Contributor

@EndBug

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

@EndBug
Copy link
Copy Markdown
Owner

EndBug commented Dec 23, 2024

@all-contributors please add @kjswartz for their code contribution

@allcontributors
Copy link
Copy Markdown
Contributor

@EndBug

I've put up a pull request to add @kjswartz! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support Iteration field type

2 participants