MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / addLabelToIssue

Function addLabelToIssue

scripts/tagLinearIssuesWithRelease.mjs:232–251  ·  view source on GitHub ↗

* Add a label to an issue

(issueId, labelId, existingLabelIds)

Source from the content-addressed store, hash-verified

230 * Add a label to an issue
231 */
232async 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
253async function main() {
254 const version = process.argv[2];

Callers 1

mainFunction · 0.85

Calls 1

linearGraphQLFunction · 0.85

Tested by

no test coverage detected