Skip to content

Commit

Permalink
Merge pull request #61 from maxfilov/main
Browse files Browse the repository at this point in the history
Add markdown description
  • Loading branch information
w-haibara authored Sep 9, 2024
2 parents aec65c4 + 63223f5 commit c1d94a3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 40 deletions.
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

0 comments on commit c1d94a3

Please sign in to comment.