Send the Data to Linear API
Use Linear's createIssue mutation via GraphQL.
Example API Call using fetch in JavaScript:
fetch in JavaScript:const response = await fetch('https://api.linear.app/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_LINEAR_API_KEY'
},
body: JSON.stringify({
query: `
mutation {
issueCreate(
input: {
teamId: "team-id-here",
title: "Bug report from user",
description: "User uploaded issue details go here"
}
) {
success
issue {
id
identifier
url
}
}
}
`
})
});
const data = await response.json();
console.log(data);Team ID can be obtained from the Linear API or GraphQL Explorer.
Last updated