GitHub "Search Milestones" and "Get a Milestone" modules missing Milestone ID in output

Hello,

I’m trying to get the GitHub node ID for a Milestone so that I can update my issues with the current Milestone in a given scenario.

While both Search Milestones and Get a Milestone return the milestones as intended, the information is incomplete. It’s missing the Milestones’ node IDs.

I’m unable to assign the milestone using the number, URL, resource path, etc… But where I’m expecting the ID, its not included in the output bundle(s):


Is this maybe a specific permissions issue with the OAuth connection, or a known issue with these GitHub modules themselves?

Hey SchemaApp

Just to start out somewhere, what permissions does the fine-grained token have, that you are using to requst the milestones?

Hi GIGO, the acquired permissions that the Connection has are repo, public_repo.

From the docume tation (REST API endpoints for milestones - GitHub Docs) it seems it needs:

  • “Issues” repository permissions (read)
  • “Pull requests” repository permissions (read)

I would start there. :+1:

1 Like

Thanks again for your initial assistance here GIGO.

The permissions ended up being fine here, the repo and public_repo were enough: the solution we ended up using was using the “Execute a GraphQL Query” instead of using the “Search Milestones” or “Get a Milestone” modules, as these did not seem to successfully return and Milestone IDs.

Both querying for the milestone ID and using a mutation to modify/update issues were straightforward to do using GraphQL. Posting an example here for posterity / to help out others who need to do something similar with the GitHub integration

Query and Mutation examples for getting/setting Milestone IDs

  • Querying for milestone IDs, we queried on the repository for the milestones on the repository object, e.g.:

    query { 
    	repository(owner: "MyRepoOwner", name: "MyRepoName") { 
    		milestones(first: 3, states: [OPEN], orderBy: { 
    			field: DUE_DATE, direction: ASC
    		}) {
    			nodes { 
    				id 
    				title 
    				dueOn
    			}
    		}
    	}
    }
    
    • Replace the MyRepoOwner and MyRepoName above with your own strings, or dynamically using your own output bundles.
    • We did some later filtering of the results based on the current date and the dueOn, using an array iterator + array aggregator to iterate through the nodes and filter on which milestone we needed. You mave have different needs, but this is what we used:

  • Assigning milestone IDs, we used the updateIssue mutation to both assign issues and set the milestone ID, e.g.:

    mutation UpdateIssue($issueId: ID!, $milestoneId: ID, $assigneeId: ID!) {
      updateIssue(input: { id: $issueId, milestoneId: $milestoneId, assigneeIds: [$assigneeId] }) {
        issue {
          id
          title
          milestone {
            id
            title
          }
          assignees(first: 10) {
            nodes {
              id
              login
            }
          }
        }
      }
    }
    
    • The variables we used were the issueId, milestoneId, and assigneeId retrieved from the output bundles of previous modules.
1 Like