Skip to content
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

Add markdown description #61

Merged
merged 1 commit into from
Sep 9, 2024
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
72 changes: 37 additions & 35 deletions clickup/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type GetBulkTasksTimeInStatusResponse map[string]TasksInStatus
type TaskRequest struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
MarkdownDescription string `json:"markdown_description,omitempty"`
Assignees []int `json:"assignees,omitempty"`
Tags []string `json:"tags,omitempty"`
Status string `json:"status,omitempty"`
Expand Down Expand Up @@ -68,41 +69,42 @@ type CustomFieldInTaskRequest struct {
}

type Task struct {
ID string `json:"id"`
CustomID string `json:"custom_id"`
CustomItemId int `json:"custom_item_id"` // A null value means this item is a task. A value of 1 is a Milestone. Any other number is a custom task type.
Name string `json:"name"`
TextContent string `json:"text_content"`
Description string `json:"description"`
Status TaskStatus `json:"status"`
Orderindex json.Number `json:"orderindex"`
DateCreated string `json:"date_created"`
DateUpdated string `json:"date_updated"`
DateClosed string `json:"date_closed"`
Archived bool `json:"archived"`
Creator User `json:"creator"`
Assignees []User `json:"assignees,omitempty"`
Watchers []User `json:"watchers,omitempty"`
Checklists []Checklist `json:"checklists,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Parent string `json:"parent"`
Priority TaskPriority `json:"priority"`
DueDate *Date `json:"due_date,omitempty"`
StartDate string `json:"start_date,omitempty"`
Points Point `json:"points,omitempty"`
TimeEstimate int64 `json:"time_estimate"`
TimeSpent int64 `json:"time_spent"`
CustomFields []CustomField `json:"custom_fields"`
Dependencies []Dependence `json:"dependencies"`
LinkedTasks []LinkedTask `json:"linked_tasks"`
TeamID string `json:"team_id"`
URL string `json:"url"`
PermissionLevel string `json:"permission_level"`
List ListOfTaskBelonging `json:"list"`
Project ProjectOfTaskBelonging `json:"project"`
Folder FolderOftaskBelonging `json:"folder"`
Space SpaceOfTaskBelonging `json:"space"`
Attachments []TaskAttachment `json:"attachments"`
ID string `json:"id"`
CustomID string `json:"custom_id"`
CustomItemId int `json:"custom_item_id"` // A null value means this item is a task. A value of 1 is a Milestone. Any other number is a custom task type.
Name string `json:"name"`
TextContent string `json:"text_content"`
Description string `json:"description"`
MarkdownDescription string `json:"markdown_description"`
Status TaskStatus `json:"status"`
Orderindex json.Number `json:"orderindex"`
DateCreated string `json:"date_created"`
DateUpdated string `json:"date_updated"`
DateClosed string `json:"date_closed"`
Archived bool `json:"archived"`
Creator User `json:"creator"`
Assignees []User `json:"assignees,omitempty"`
Watchers []User `json:"watchers,omitempty"`
Checklists []Checklist `json:"checklists,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Parent string `json:"parent"`
Priority TaskPriority `json:"priority"`
DueDate *Date `json:"due_date,omitempty"`
StartDate string `json:"start_date,omitempty"`
Points Point `json:"points,omitempty"`
TimeEstimate int64 `json:"time_estimate"`
TimeSpent int64 `json:"time_spent"`
CustomFields []CustomField `json:"custom_fields"`
Dependencies []Dependence `json:"dependencies"`
LinkedTasks []LinkedTask `json:"linked_tasks"`
TeamID string `json:"team_id"`
URL string `json:"url"`
PermissionLevel string `json:"permission_level"`
List ListOfTaskBelonging `json:"list"`
Project ProjectOfTaskBelonging `json:"project"`
Folder FolderOftaskBelonging `json:"folder"`
Space SpaceOfTaskBelonging `json:"space"`
Attachments []TaskAttachment `json:"attachments"`
}

type TaskAttachment struct {
Expand Down
12 changes: 7 additions & 5 deletions clickup/tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestTasksService_GetTask(t *testing.T) {
"name": "Task Name",
"text_content": "New Task Description",
"description": "New Task Description",
"markdown_description": "## New Task Description",
"status": {
"status": "in progress",
"color": "#d3d3d3",
Expand Down Expand Up @@ -81,11 +82,12 @@ func TestTasksService_GetTask(t *testing.T) {
}

want := &Task{
ID: "9hx",
CustomItemId: 0,
Name: "Task Name",
TextContent: "New Task Description",
Description: "New Task Description",
ID: "9hx",
CustomItemId: 0,
Name: "Task Name",
TextContent: "New Task Description",
Description: "New Task Description",
MarkdownDescription: "## New Task Description",
Status: TaskStatus{
Status: "in progress",
Color: "#d3d3d3",
Expand Down
Loading