Skip to content

Commit cef1e1b

Browse files
Merging pull request PipedreamHQ#18378
* Update Taiga component with new actions and sources - Bump version to 0.1.0 in package.json and add dependency on @pipedream/platform. - Introduce new actions for creating, updating, and deleting issues, tasks, and user stories. - Add sources for tracking changes and deletions of issues and tasks. - Implement utility functions for parsing and cleaning objects in common/utils.mjs. - Enhance prop definitions for better integration with Taiga API. * pnpm update * Refactor Taiga actions to utilize parseObject utility - Added parseObject utility for tags, watchers, and points in update-issue, update-task, and update-userstory actions. - Removed the update-project action as it is no longer needed. - Enhanced base source to include secret key validation for webhook security.
1 parent 07aa960 commit cef1e1b

File tree

32 files changed

+3122
-8
lines changed

32 files changed

+3122
-8
lines changed
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
import { parseObject } from "../../common/utils.mjs";
2+
import taiga from "../../taiga.app.mjs";
3+
4+
export default {
5+
key: "taiga-create-issue",
6+
name: "Create Issue",
7+
description: "Create a new issue in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#issues-create)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
taiga,
12+
projectId: {
13+
propDefinition: [
14+
taiga,
15+
"projectId",
16+
],
17+
},
18+
subject: {
19+
propDefinition: [
20+
taiga,
21+
"issueSubject",
22+
],
23+
},
24+
description: {
25+
propDefinition: [
26+
taiga,
27+
"issueDescription",
28+
],
29+
optional: true,
30+
},
31+
priority: {
32+
propDefinition: [
33+
taiga,
34+
"issuePriority",
35+
({ projectId }) => ({
36+
projectId,
37+
}),
38+
],
39+
optional: true,
40+
},
41+
severity: {
42+
propDefinition: [
43+
taiga,
44+
"issueSeverity",
45+
({ projectId }) => ({
46+
projectId,
47+
}),
48+
],
49+
optional: true,
50+
},
51+
status: {
52+
propDefinition: [
53+
taiga,
54+
"issueStatus",
55+
({ projectId }) => ({
56+
projectId,
57+
}),
58+
],
59+
optional: true,
60+
},
61+
type: {
62+
propDefinition: [
63+
taiga,
64+
"issueType",
65+
({ projectId }) => ({
66+
projectId,
67+
}),
68+
],
69+
optional: true,
70+
},
71+
assignedTo: {
72+
propDefinition: [
73+
taiga,
74+
"userId",
75+
({ projectId }) => ({
76+
projectId,
77+
}),
78+
],
79+
label: "Assigned To",
80+
description: "User to assign the issue to",
81+
optional: true,
82+
},
83+
milestone: {
84+
propDefinition: [
85+
taiga,
86+
"milestone",
87+
({ projectId }) => ({
88+
projectId,
89+
}),
90+
],
91+
optional: true,
92+
},
93+
tags: {
94+
propDefinition: [
95+
taiga,
96+
"tags",
97+
],
98+
optional: true,
99+
},
100+
blockedNote: {
101+
propDefinition: [
102+
taiga,
103+
"issueBlockedNote",
104+
],
105+
optional: true,
106+
},
107+
isBlocked: {
108+
propDefinition: [
109+
taiga,
110+
"isBlocked",
111+
],
112+
optional: true,
113+
},
114+
watchers: {
115+
propDefinition: [
116+
taiga,
117+
"userId",
118+
({ projectId }) => ({
119+
projectId,
120+
}),
121+
],
122+
type: "string[]",
123+
label: "Watchers",
124+
description: "Users to watch the issue",
125+
optional: true,
126+
},
127+
},
128+
async run({ $ }) {
129+
const response = await this.taiga.createIssue({
130+
$,
131+
data: {
132+
subject: this.subject,
133+
description: this.description,
134+
project: this.projectId,
135+
priority: this.priority,
136+
severity: this.severity,
137+
status: this.status,
138+
type: this.type,
139+
assigned_to: this.assignedTo,
140+
tags: parseObject(this.tags),
141+
blocked_note: this.blockedNote,
142+
is_blocked: this.isBlocked,
143+
milestone: this.milestone,
144+
watchers: parseObject(this.watchers),
145+
},
146+
});
147+
148+
$.export("$summary", `Created issue: ${response.id}`);
149+
return response;
150+
},
151+
};
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
import { parseObject } from "../../common/utils.mjs";
2+
import taiga from "../../taiga.app.mjs";
3+
4+
export default {
5+
key: "taiga-create-task",
6+
name: "Create Task",
7+
description: "Create a new task in a Taiga project. [See the documentation](https://docs.taiga.io/api.html#tasks-create)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
taiga,
12+
projectId: {
13+
propDefinition: [
14+
taiga,
15+
"projectId",
16+
],
17+
},
18+
subject: {
19+
propDefinition: [
20+
taiga,
21+
"taskSubject",
22+
],
23+
},
24+
description: {
25+
propDefinition: [
26+
taiga,
27+
"taskDescription",
28+
],
29+
optional: true,
30+
},
31+
isBlocked: {
32+
propDefinition: [
33+
taiga,
34+
"isBlocked",
35+
],
36+
description: "Whether the task is blocked",
37+
optional: true,
38+
},
39+
milestone: {
40+
propDefinition: [
41+
taiga,
42+
"milestone",
43+
({ projectId }) => ({
44+
projectId,
45+
}),
46+
],
47+
optional: true,
48+
},
49+
status: {
50+
propDefinition: [
51+
taiga,
52+
"taskStatus",
53+
({ projectId }) => ({
54+
projectId,
55+
}),
56+
],
57+
optional: true,
58+
},
59+
assignedTo: {
60+
propDefinition: [
61+
taiga,
62+
"userId",
63+
({ projectId }) => ({
64+
projectId,
65+
}),
66+
],
67+
label: "Assigned To",
68+
description: "User to assign the task to",
69+
optional: true,
70+
},
71+
userStoryId: {
72+
propDefinition: [
73+
taiga,
74+
"userStoryId",
75+
({ projectId }) => ({
76+
projectId,
77+
}),
78+
],
79+
label: "User Story",
80+
description: "User story to associate the task with",
81+
optional: true,
82+
},
83+
usOrder: {
84+
propDefinition: [
85+
taiga,
86+
"usOrder",
87+
],
88+
optional: true,
89+
},
90+
taskboardOrder: {
91+
propDefinition: [
92+
taiga,
93+
"taskboardOrder",
94+
],
95+
optional: true,
96+
},
97+
tags: {
98+
propDefinition: [
99+
taiga,
100+
"tags",
101+
],
102+
description: "Tags to associate with the task",
103+
optional: true,
104+
},
105+
watchers: {
106+
propDefinition: [
107+
taiga,
108+
"userId",
109+
({ projectId }) => ({
110+
projectId,
111+
}),
112+
],
113+
type: "string[]",
114+
label: "Watchers",
115+
description: "Users to watch the task",
116+
optional: true,
117+
},
118+
},
119+
async run({ $ }) {
120+
const response = await this.taiga.createTask({
121+
$,
122+
data: {
123+
subject: this.subject,
124+
description: this.description,
125+
project: this.projectId,
126+
status: this.status,
127+
assigned_to: this.assignedTo,
128+
user_story: this.userStoryId,
129+
tags: parseObject(this.tags),
130+
is_blocked: this.isBlocked,
131+
milestone: this.milestone,
132+
user_story_order: this.usOrder,
133+
taskboard_order: this.taskboardOrder,
134+
watchers: parseObject(this.watchers),
135+
},
136+
});
137+
138+
$.export("$summary", `Created task: ${response.id}`);
139+
return response;
140+
},
141+
};

0 commit comments

Comments
 (0)