Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions components/linear_app/actions/create-issue/create-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default {
type: "action",
key: "linear_app-create-issue",
name: "Create Issue",
description: "Creates a new issue in Linear. Requires team ID and title. Optional: description, assignee, project, state. Returns response object with success status and issue details. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).",
version: "0.4.13",
description: "Creates a new issue in Linear. Requires team ID and title. Optional: description, assignee, project, state. Returns response object with success status and issue details. Uses API Key authentication. [See the documentation](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).",
version: "0.4.14",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down Expand Up @@ -55,6 +55,21 @@ export default {
}),
],
},
labelIds: {
propDefinition: [
linearApp,
"issueLabels",
() => ({
byId: true,
}),
],
},
priority: {
propDefinition: [
linearApp,
"issuePriority",
],
},
},
async run({ $ }) {
const {
Expand All @@ -65,6 +80,8 @@ export default {
teamId,
assigneeId,
stateId,
labelIds,
priority,
} = this;

const response =
Expand All @@ -75,6 +92,8 @@ export default {
description,
assigneeId,
stateId,
labelIds,
priority,
});

const summary = response.success
Expand Down
93 changes: 93 additions & 0 deletions components/linear_app/actions/create-project/create-project.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import linearApp from "../../linear_app.app.mjs";

export default {
key: "linear_app-create-project",
name: "Create Project",
description: "Create a project in Linear. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/inputs/ProjectCreateInput).",
type: "action",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
linearApp,
teamId: {
propDefinition: [
linearApp,
"teamId",
],
},
name: {
type: "string",
label: "Name",
description: "The name of the project",
},
description: {
type: "string",
label: "Description",
description: "The description of the project",
optional: true,
},
statusId: {
propDefinition: [
linearApp,
"projectStatusId",
],
},
priority: {
propDefinition: [
linearApp,
"projectPriority",
],
},
memberIds: {
propDefinition: [
linearApp,
"assigneeId",
],
type: "string[]",
label: "Member IDs",
description: "The IDs of the members of the project",
optional: true,
},
startDate: {
type: "string",
label: "Start Date",
description: "The start date of the project in ISO 8601 format",
optional: true,
},
targetDate: {
type: "string",
label: "Target Date",
description: "The target date of the project in ISO 8601 format",
optional: true,
},
labelIds: {
propDefinition: [
linearApp,
"projectLabelIds",
],
},
},
async run({ $ }) {
const response = await this.linearApp.client().createProject({
teamIds: [
this.teamId,
],
name: this.name,
description: this.description,
statusId: this.statusId,
priority: this.priority,
memberIds: this.memberIds,
startDate: this.startDate,
targetDate: this.targetDate,
labelIds: this.labelIds,
});

$.export("$summary", `Successfully created project with ID ${response._project.id}`);

return response;
},
};
2 changes: 1 addition & 1 deletion components/linear_app/actions/get-issue/get-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "linear_app-get-issue",
name: "Get Issue",
description: "Retrieves a Linear issue by its ID. Returns complete issue details including title, description, state, assignee, team, project, labels, and timestamps. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
version: "0.1.13",
version: "0.1.14",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/linear_app/actions/get-teams/get-teams.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "linear_app-get-teams",
name: "Get Teams",
description: "Retrieves all teams in your Linear workspace. Returns array of team objects with details like ID, name, and key. Supports pagination with configurable limit. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
version: "0.2.13",
version: "0.2.14",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
66 changes: 66 additions & 0 deletions components/linear_app/actions/list-projects/list-projects.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import linearApp from "../../linear_app.app.mjs";
import utils from "../../common/utils.mjs";

export default {
key: "linear_app-list-projects",
name: "List Projects",
description: "List projects in Linear. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/objects/ProjectConnection?query=projects).",
type: "action",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
linearApp,
teamId: {
propDefinition: [
linearApp,
"teamId",
],
},
orderBy: {
propDefinition: [
linearApp,
"orderBy",
],
},
first: {
type: "integer",
label: "First",
description: "The number of projects to return",
optional: true,
},
after: {
type: "string",
label: "After",
description: "The cursor to return the next page of projects",
optional: true,
},
},
async run({ $ }) {
const variables = utils.buildVariables(this.after, {
filter: {
accessibleTeams: {
id: {
eq: this.teamId,
},
},
},
orderBy: this.orderBy,
limit: this.first,
});

const {
nodes, pageInfo,
} = await this.linearApp.listProjects(variables);

$.export("$summary", `Found ${nodes.length} projects`);

return {
nodes,
pageInfo,
};
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "Search Issues",
description: "Searches Linear issues by team, project, assignee, labels, state, or text query. Supports pagination, ordering, and archived issues. Returns array of matching issues. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api).",
type: "action",
version: "0.2.13",
version: "0.2.14",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
34 changes: 32 additions & 2 deletions components/linear_app/actions/update-issue/update-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import linearApp from "../../linear_app.app.mjs";
export default {
key: "linear_app-update-issue",
name: "Update Issue",
description: "Updates an existing Linear issue. Can modify title, description, assignee, state, project, team, labels, priority, and dates. Returns updated issue details. Uses API Key authentication. See Linear docs for additional info [here](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).",
description: "Updates an existing Linear issue. Can modify title, description, assignee, state, project, team, labels, priority, and dates. Returns updated issue details. Uses API Key authentication. [See the documentation](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#creating-and-editing-issues).",
type: "action",
version: "0.1.13",
version: "0.1.14",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down Expand Up @@ -68,6 +68,30 @@ export default {
"assigneeId",
],
},
labelIds: {
propDefinition: [
linearApp,
"issueLabels",
() => ({
byId: true,
}),
],
},
projectId: {
propDefinition: [
linearApp,
"projectId",
({ teamId }) => ({
teamId,
}),
],
},
priority: {
propDefinition: [
linearApp,
"issuePriority",
],
},
},
async run({ $ }) {
const {
Expand All @@ -77,6 +101,9 @@ export default {
teamIdToUpdate,
stateId,
assigneeId,
labelIds,
projectId,
priority,
} = this;

const response =
Expand All @@ -88,6 +115,9 @@ export default {
description,
assigneeId,
stateId,
labelIds,
projectId,
priority,
},
});

Expand Down
24 changes: 24 additions & 0 deletions components/linear_app/common/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ const ORDER_BY_OPTIONS = [
},
];

const PRIORITY_OPTIONS = [
{
value: 0,
label: "No priority",
},
{
value: 1,
label: "Urgent",
},
{
value: 2,
label: "High",
},
{
value: 3,
label: "Normal",
},
{
value: 4,
label: "Low",
},
];

export default {
WEBHOOK_ID,
LINEAR_DELIVERY_HEADER,
Expand All @@ -57,4 +80,5 @@ export default {
CLIENT_IPS,
ORDER_BY_OPTIONS,
FIELD,
PRIORITY_OPTIONS,
};
Loading
Loading