-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[ACTION] Click Up - Create Time Entry #17798 #17861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
560cf39
Added actions
lcaresia 4b1d751
Added actions
lcaresia d0c4f12
Added actions
lcaresia 0a7b783
Merge branch 'master' into issue-17798
lcaresia f97516c
Merge branch 'master' into issue-17798
lcaresia d36ac65
Merge branch 'master' into issue-17798
lcaresia 9feac47
Added actions
lcaresia 3e8f0d2
Fix prop description
vunguyenhung 87b85a5
Merge branch 'master' into issue-17798
lcaresia 495b54d
Added actions
lcaresia b371fdc
Merge branch 'master' into issue-17798
lcaresia 025f445
Merge branch 'master' into issue-17798
lcaresia f71346f
Merge branch 'master' into issue-17798
lcaresia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
components/clickup/actions/create-time-entry/create-time-entry.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import app from "../../clickup.app.mjs"; | ||
| import common from "../common/task-props.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "clickup-create-time-entry", | ||
| name: "Create Time Entry", | ||
| description: "Create a new time entry. [See the documentation](https://developer.clickup.com/reference/createatimeentry)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| ...common.props, | ||
| folderId: { | ||
| propDefinition: [ | ||
| common.props.clickup, | ||
| "folderId", | ||
| (c) => ({ | ||
| spaceId: c.spaceId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| listId: { | ||
| propDefinition: [ | ||
| common.props.clickup, | ||
| "listId", | ||
| (c) => ({ | ||
| folderId: c.folderId, | ||
| spaceId: c.spaceId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| taskId: { | ||
| propDefinition: [ | ||
| common.props.clickup, | ||
| "taskId", | ||
| (c) => ({ | ||
| listId: c.listId, | ||
| useCustomTaskIds: c.useCustomTaskIds, | ||
| authorizedTeamId: c.authorizedTeamId, | ||
| }), | ||
| ], | ||
| description: "To show options please select a **List** first", | ||
| optional: true, | ||
| }, | ||
| tags: { | ||
| propDefinition: [ | ||
| app, | ||
| "tags", | ||
| (c) => ({ | ||
| spaceId: c.spaceId, | ||
| }), | ||
| ], | ||
| optional: true, | ||
| }, | ||
| start: { | ||
| type: "string", | ||
| label: "Start Time", | ||
| description: "The Start Time, can be ISO 8601 Date (.e.g `2025-08-06T01:50:19Z`) or Unix timestamp in milliseconds (.e.g `1595282645000`)", | ||
| }, | ||
| end: { | ||
| type: "string", | ||
| label: "End Time", | ||
| description: "The End Time, can be ISO 8601 Date (.e.g `2025-08-06T01:50:19Z`) or Unix timestamp in milliseconds (.e.g `1595282645000`)", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "Description of the time entry", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const start = new Date(+this.start || this.start).getTime(); | ||
| const end = new Date(+this.end || this.end).getTime(); | ||
|
|
||
| const data = { | ||
| tid: this.taskId, | ||
| description: this.description, | ||
| start, | ||
| end, | ||
| stop: end, | ||
| }; | ||
|
|
||
| console.log(data); | ||
|
|
||
| const response = await this.clickup.createTimeEntry({ | ||
| $, | ||
| teamId: this.workspaceId, | ||
| params: { | ||
| custom_task_ids: this.useCustomTaskIds, | ||
| }, | ||
| data, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully created a new time entry"); | ||
|
|
||
| return response; | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use the tags prop in the API payload when provided.
tags is defined but not used. Include it conditionally.
const data = { tid: this.taskId, description: this.description, start, end, + ...(this.tags?.length ? { tags: this.tags } : {}), };Also applies to: 47-56
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why the tags property isn't being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 1361
🏁 Script executed:
Length of output: 1705
@GTFalcao Looking at the code, this appears to be an oversight. The
tagsprop is defined in the component (lines 47-56) but isn't included in the API payload (lines 77-83).Comparing with the
create-taskaction which also has a tags prop, that action correctly includestagsin its data payload:The
create-time-entryaction should similarly include tags when constructing the data object. The fix would be to add tags to the payload:This way, tags will be passed to the ClickUp API when provided by the user, maintaining consistency with other ClickUp actions.