Skip to content

Commit 560cf39

Browse files
committed
Added actions
1 parent a5a1152 commit 560cf39

File tree

4 files changed

+111
-14
lines changed

4 files changed

+111
-14
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import app from "../../clickup.app.mjs";
2+
import common from "../common/task-props.mjs";
3+
4+
export default {
5+
...common,
6+
key: "clickup-create-time-entry",
7+
name: "Create Time Entry",
8+
description: "Create a new time entry. [See the documentation](https://developer.clickup.com/reference/createatimeentry)",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
...common.props,
13+
folderId: {
14+
propDefinition: [
15+
common.props.clickup,
16+
"folderId",
17+
(c) => ({
18+
spaceId: c.spaceId,
19+
}),
20+
],
21+
optional: true,
22+
},
23+
listId: {
24+
propDefinition: [
25+
common.props.clickup,
26+
"listId",
27+
(c) => ({
28+
folderId: c.folderId,
29+
spaceId: c.spaceId,
30+
}),
31+
],
32+
optional: true,
33+
},
34+
taskId: {
35+
propDefinition: [
36+
common.props.clickup,
37+
"taskId",
38+
(c) => ({
39+
listId: c.listId,
40+
useCustomTaskIds: c.useCustomTaskIds,
41+
authorizedTeamId: c.authorizedTeamId,
42+
}),
43+
],
44+
description: "To show options please select a **List** first",
45+
optional: true,
46+
},
47+
tags: {
48+
propDefinition: [
49+
app,
50+
"tags",
51+
(c) => ({
52+
spaceId: c.spaceId,
53+
}),
54+
],
55+
optional: true,
56+
},
57+
start: {
58+
type: "integer",
59+
label: "Start Time",
60+
description: "Unix timestamp in milliseconds for the Start Time, e.g., `1595282645000`",
61+
},
62+
end: {
63+
type: "integer",
64+
label: "End Time",
65+
description: "Unix timestamp in milliseconds, e.g., `1595283000000`. When there are values for both start and end, duration is ignored",
66+
},
67+
description: {
68+
type: "string",
69+
label: "Description",
70+
description: "Description of the time entry",
71+
},
72+
},
73+
async run({ $ }) {
74+
const response = await this.clickup.createTimeEntry({
75+
$,
76+
teamId: this.workspaceId,
77+
params: {
78+
custom_task_ids: this.useCustomTaskIds,
79+
},
80+
data: {
81+
tid: this.taskId,
82+
description: this.description,
83+
start: this.start,
84+
end: this.end,
85+
stop: this.end,
86+
},
87+
});
88+
89+
$.export("$summary", "Successfully created a new time entry");
90+
91+
return response;
92+
},
93+
};

components/clickup/clickup.app.mjs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default {
206206
type: "string",
207207
label: "Task ID",
208208
description: "The ID of a task",
209-
async options ({
209+
async options({
210210
page, listId, useCustomTaskIds,
211211
}) {
212212
const tasks = await this.getTasks({
@@ -233,7 +233,7 @@ export default {
233233
type: "string",
234234
label: "Checklist ID",
235235
description: "To show options please select a **Task** first",
236-
async options ({
236+
async options({
237237
taskId, useCustomTaskIds, authorizedTeamId,
238238
}) {
239239
if (!taskId) {
@@ -270,7 +270,7 @@ export default {
270270
type: "string",
271271
label: "Comment ID",
272272
description: "The ID of a comment",
273-
async options ({
273+
async options({
274274
taskId, listId, viewId,
275275
}) {
276276
if (!taskId && !listId && !viewId) {
@@ -883,5 +883,14 @@ export default {
883883
method: "post",
884884
}, $);
885885
},
886+
async createTimeEntry({
887+
$, teamId, data, params,
888+
}) {
889+
return this._makeRequest(`team/${teamId}/time_entries`, {
890+
method: "post",
891+
params,
892+
data,
893+
}, $);
894+
},
886895
},
887896
};

components/clickup/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/clickup",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "Pipedream Clickup Components",
55
"main": "clickup.app.mjs",
66
"keywords": [

pnpm-lock.yaml

Lines changed: 5 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)