Skip to content

How to convert a project card into an issue #1969

Answered by gr2m
mirusky asked this question in Q&A
Discussion options

You must be logged in to vote

There doesn't seem to be a REST API endpoint to convert a project card to an issue, but a GraphQL Mutation: convertProjectCardNoteToIssue

await octokit.graphql(`
  mutation ($cardId: ID!, $repositoryId: ID!, $title: String, $body: String) {
    convertProjectCardNoteToIssue(input: {projectCardId: $cardId, repositoryId: $repositoryId, title: $title, body: $body}) {
      clientMutationId
    }
  }
`, {
  projectCardId: context.payload.project_card.node_id,
  repositoryId: context.payload.repository.node_id,
  // optional
  title: 'new issue title', // defaults to card content
  body: 'new issue description'
})

Does that work for you?

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mirusky
Comment options

@mirusky

This comment has been hidden.

@gr2m

This comment has been hidden.

Answer selected by mirusky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1969 on December 12, 2020 06:31.