Skip to content

Commit ffb9b81

Browse files
authored
Linear App - updates and new components (#18606)
* updates * pnpm-lock.yaml * versions * fix doc links * bug fix & add priority prop
1 parent f6ef061 commit ffb9b81

File tree

17 files changed

+317
-20
lines changed

17 files changed

+317
-20
lines changed

components/linear_app/actions/create-issue/create-issue.mjs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export default {
44
type: "action",
55
key: "linear_app-create-issue",
66
name: "Create Issue",
7-
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).",
8-
version: "0.4.13",
7+
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).",
8+
version: "0.4.14",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,
@@ -55,6 +55,21 @@ export default {
5555
}),
5656
],
5757
},
58+
labelIds: {
59+
propDefinition: [
60+
linearApp,
61+
"issueLabels",
62+
() => ({
63+
byId: true,
64+
}),
65+
],
66+
},
67+
priority: {
68+
propDefinition: [
69+
linearApp,
70+
"issuePriority",
71+
],
72+
},
5873
},
5974
async run({ $ }) {
6075
const {
@@ -65,6 +80,8 @@ export default {
6580
teamId,
6681
assigneeId,
6782
stateId,
83+
labelIds,
84+
priority,
6885
} = this;
6986

7087
const response =
@@ -75,6 +92,8 @@ export default {
7592
description,
7693
assigneeId,
7794
stateId,
95+
labelIds,
96+
priority,
7897
});
7998

8099
const summary = response.success
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import linearApp from "../../linear_app.app.mjs";
2+
3+
export default {
4+
key: "linear_app-create-project",
5+
name: "Create Project",
6+
description: "Create a project in Linear. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/inputs/ProjectCreateInput).",
7+
type: "action",
8+
version: "0.0.1",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: false,
13+
},
14+
props: {
15+
linearApp,
16+
teamId: {
17+
propDefinition: [
18+
linearApp,
19+
"teamId",
20+
],
21+
},
22+
name: {
23+
type: "string",
24+
label: "Name",
25+
description: "The name of the project",
26+
},
27+
description: {
28+
type: "string",
29+
label: "Description",
30+
description: "The description of the project",
31+
optional: true,
32+
},
33+
statusId: {
34+
propDefinition: [
35+
linearApp,
36+
"projectStatusId",
37+
],
38+
},
39+
priority: {
40+
propDefinition: [
41+
linearApp,
42+
"projectPriority",
43+
],
44+
},
45+
memberIds: {
46+
propDefinition: [
47+
linearApp,
48+
"assigneeId",
49+
],
50+
type: "string[]",
51+
label: "Member IDs",
52+
description: "The IDs of the members of the project",
53+
optional: true,
54+
},
55+
startDate: {
56+
type: "string",
57+
label: "Start Date",
58+
description: "The start date of the project in ISO 8601 format",
59+
optional: true,
60+
},
61+
targetDate: {
62+
type: "string",
63+
label: "Target Date",
64+
description: "The target date of the project in ISO 8601 format",
65+
optional: true,
66+
},
67+
labelIds: {
68+
propDefinition: [
69+
linearApp,
70+
"projectLabelIds",
71+
],
72+
},
73+
},
74+
async run({ $ }) {
75+
const response = await this.linearApp.client().createProject({
76+
teamIds: [
77+
this.teamId,
78+
],
79+
name: this.name,
80+
description: this.description,
81+
statusId: this.statusId,
82+
priority: this.priority,
83+
memberIds: this.memberIds,
84+
startDate: this.startDate,
85+
targetDate: this.targetDate,
86+
labelIds: this.labelIds,
87+
});
88+
89+
$.export("$summary", `Successfully created project with ID ${response._project.id}`);
90+
91+
return response;
92+
},
93+
};

components/linear_app/actions/get-issue/get-issue.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "linear_app-get-issue",
55
name: "Get Issue",
66
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).",
7-
version: "0.1.13",
7+
version: "0.1.14",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/linear_app/actions/get-teams/get-teams.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "linear_app-get-teams",
66
name: "Get Teams",
77
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).",
8-
version: "0.2.13",
8+
version: "0.2.14",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import linearApp from "../../linear_app.app.mjs";
2+
import utils from "../../common/utils.mjs";
3+
4+
export default {
5+
key: "linear_app-list-projects",
6+
name: "List Projects",
7+
description: "List projects in Linear. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/objects/ProjectConnection?query=projects).",
8+
type: "action",
9+
version: "0.0.1",
10+
annotations: {
11+
destructiveHint: false,
12+
openWorldHint: true,
13+
readOnlyHint: true,
14+
},
15+
props: {
16+
linearApp,
17+
teamId: {
18+
propDefinition: [
19+
linearApp,
20+
"teamId",
21+
],
22+
},
23+
orderBy: {
24+
propDefinition: [
25+
linearApp,
26+
"orderBy",
27+
],
28+
},
29+
first: {
30+
type: "integer",
31+
label: "First",
32+
description: "The number of projects to return",
33+
optional: true,
34+
},
35+
after: {
36+
type: "string",
37+
label: "After",
38+
description: "The cursor to return the next page of projects",
39+
optional: true,
40+
},
41+
},
42+
async run({ $ }) {
43+
const variables = utils.buildVariables(this.after, {
44+
filter: {
45+
accessibleTeams: {
46+
id: {
47+
eq: this.teamId,
48+
},
49+
},
50+
},
51+
orderBy: this.orderBy,
52+
limit: this.first,
53+
});
54+
55+
const {
56+
nodes, pageInfo,
57+
} = await this.linearApp.listProjects(variables);
58+
59+
$.export("$summary", `Found ${nodes.length} projects`);
60+
61+
return {
62+
nodes,
63+
pageInfo,
64+
};
65+
},
66+
};

components/linear_app/actions/search-issues/search-issues.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "Search Issues",
88
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).",
99
type: "action",
10-
version: "0.2.13",
10+
version: "0.2.14",
1111
annotations: {
1212
destructiveHint: false,
1313
openWorldHint: true,

components/linear_app/actions/update-issue/update-issue.mjs

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import linearApp from "../../linear_app.app.mjs";
33
export default {
44
key: "linear_app-update-issue",
55
name: "Update Issue",
6-
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).",
6+
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).",
77
type: "action",
8-
version: "0.1.13",
8+
version: "0.1.14",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,
@@ -68,6 +68,30 @@ export default {
6868
"assigneeId",
6969
],
7070
},
71+
labelIds: {
72+
propDefinition: [
73+
linearApp,
74+
"issueLabels",
75+
() => ({
76+
byId: true,
77+
}),
78+
],
79+
},
80+
projectId: {
81+
propDefinition: [
82+
linearApp,
83+
"projectId",
84+
({ teamId }) => ({
85+
teamId,
86+
}),
87+
],
88+
},
89+
priority: {
90+
propDefinition: [
91+
linearApp,
92+
"issuePriority",
93+
],
94+
},
7195
},
7296
async run({ $ }) {
7397
const {
@@ -77,6 +101,9 @@ export default {
77101
teamIdToUpdate,
78102
stateId,
79103
assigneeId,
104+
labelIds,
105+
projectId,
106+
priority,
80107
} = this;
81108

82109
const response =
@@ -88,6 +115,9 @@ export default {
88115
description,
89116
assigneeId,
90117
stateId,
118+
labelIds,
119+
projectId,
120+
priority,
91121
},
92122
});
93123

components/linear_app/common/constants.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,29 @@ const ORDER_BY_OPTIONS = [
4545
},
4646
];
4747

48+
const PRIORITY_OPTIONS = [
49+
{
50+
value: 0,
51+
label: "No priority",
52+
},
53+
{
54+
value: 1,
55+
label: "Urgent",
56+
},
57+
{
58+
value: 2,
59+
label: "High",
60+
},
61+
{
62+
value: 3,
63+
label: "Normal",
64+
},
65+
{
66+
value: 4,
67+
label: "Low",
68+
},
69+
];
70+
4871
export default {
4972
WEBHOOK_ID,
5073
LINEAR_DELIVERY_HEADER,
@@ -57,4 +80,5 @@ export default {
5780
CLIENT_IPS,
5881
ORDER_BY_OPTIONS,
5982
FIELD,
83+
PRIORITY_OPTIONS,
6084
};

0 commit comments

Comments
 (0)