This PR make it possible to get value of custom field via Get Task API.
task, _, _ := client.Tasks.GetTask(ctx, id, nil)
for _, field := range task.CustomFields {
v := field.GetValue() // value of custom field
// process to use v
}
GetValue() returns interface value. It can be cast in concrete type. What type can be cast depends on the CustomField.Type as shown in the table below.
CustomField.Type
Type of GetValue() returns value
url, email, phone, text, short_text
string
number, formula
float64
checkbox
bool
date
time.Time
currency
clickup.CurrencyValue
emoji
clickup.EmojiValue
location
clickup.LocationValue
automatic_progress
clickup.AutomaticProgressValue
manual_progress
clickup.ManualProgressValue
tasks
clickup.TasksValue
users
clickup.UsersValue
attachment
clickup.AttachmentValue
drop_down
clickup.DropDownValue
labels
clickup.LabelsValue
For more details, please see the example code (example/custom-fields/main.go) .
This PR make it possible to get value of custom field via Get Task API.
GetValue()
returns interface value. It can be cast in concrete type. What type can be cast depends on theCustomField.Type
as shown in the table below.CustomField.Type
GetValue()
returns valuestring
float64
bool
time.Time
clickup.CurrencyValue
clickup.EmojiValue
clickup.LocationValue
clickup.AutomaticProgressValue
clickup.ManualProgressValue
clickup.TasksValue
clickup.UsersValue
clickup.AttachmentValue
clickup.DropDownValue
clickup.LabelsValue
For more details, please see the example code (
example/custom-fields/main.go
) .