Add an issue or PR to the project. Returns the project item ID.
(project_id: str, content_id: str)
| 137 | |
| 138 | |
| 139 | def add_item_to_project(project_id: str, content_id: str) -> str: |
| 140 | """Add an issue or PR to the project. Returns the project item ID.""" |
| 141 | query = """ |
| 142 | mutation($projectId: ID!, $contentId: ID!) { |
| 143 | addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) { |
| 144 | item { |
| 145 | id |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | """ |
| 150 | data = graphql(query, {"projectId": project_id, "contentId": content_id}) |
| 151 | return data["data"]["addProjectV2ItemById"]["item"]["id"] |
| 152 | |
| 153 | |
| 154 | def get_field_and_option( |