* Add a label to an issue
(issueId, labelId, existingLabelIds)
| 230 | * Add a label to an issue |
| 231 | */ |
| 232 | async function addLabelToIssue(issueId, labelId, existingLabelIds) { |
| 233 | // Combine existing labels with the new one |
| 234 | const allLabelIds = [...new Set([...existingLabelIds, labelId])]; |
| 235 | |
| 236 | const data = await linearGraphQL( |
| 237 | ` |
| 238 | mutation($issueId: String!, $labelIds: [String!]!) { |
| 239 | issueUpdate(id: $issueId, input: { labelIds: $labelIds }) { |
| 240 | success |
| 241 | issue { |
| 242 | identifier |
| 243 | } |
| 244 | } |
| 245 | } |
| 246 | `, |
| 247 | { issueId, labelIds: allLabelIds } |
| 248 | ); |
| 249 | |
| 250 | return data.issueUpdate?.success; |
| 251 | } |
| 252 | |
| 253 | async function main() { |
| 254 | const version = process.argv[2]; |