clickup

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadInstances

func LoadInstances(dir string) ([]tracker.Instance, error)

LoadInstances reads config, applies env overrides, creates clients, and returns ready-to-use tracker instances.

func LoadInstancesWithLookup

func LoadInstancesWithLookup(dir string, lookup config.EnvLookup) ([]tracker.Instance, error)

LoadInstancesWithLookup is like LoadInstances but uses a custom env lookup function for per-project token scoping.

func LoadInstancesWithResolver

func LoadInstancesWithResolver(dir string, lookup config.EnvLookup, resolver config.SecretResolveFunc) ([]tracker.Instance, error)

LoadInstancesWithResolver is like LoadInstances but uses a custom env lookup and a vault secret resolver for 1pw:// references.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a ClickUp REST API client that implements tracker.Provider.

func New

func New(baseURL, token string, teamID string) *Client

New creates a ClickUp client with the given base URL, API token, and optional team ID.

func (*Client) AddComment

func (c *Client) AddComment(ctx context.Context, issueKey string, body string) (*tracker.Comment, error)

AddComment implements tracker.Commenter.

func (*Client) AssignIssue

func (c *Client) AssignIssue(ctx context.Context, key string, userID string) error

AssignIssue implements tracker.Assigner.

func (*Client) CreateIssue

func (c *Client) CreateIssue(ctx context.Context, issue *tracker.Issue) (*tracker.Issue, error)

CreateIssue implements tracker.Creator.

func (*Client) DeleteIssue

func (c *Client) DeleteIssue(ctx context.Context, key string) error

DeleteIssue implements tracker.Deleter.

func (*Client) EditIssue

func (c *Client) EditIssue(ctx context.Context, key string, opts tracker.EditOptions) (*tracker.Issue, error)

EditIssue implements tracker.Editor.

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser(ctx context.Context) (string, error)

GetCurrentUser implements tracker.CurrentUserGetter.

func (*Client) GetCustomFields

func (c *Client) GetCustomFields(ctx context.Context, key string) ([]CustomFieldValue, error)

GetCustomFields returns the custom field values on a task.

func (*Client) GetIssue

func (c *Client) GetIssue(ctx context.Context, key string) (*tracker.Issue, error)

GetIssue implements tracker.Getter.

func (*Client) GetMarkdownDescription

func (c *Client) GetMarkdownDescription(ctx context.Context, key string) (string, error)

GetMarkdownDescription fetches the task's markdown description source.

func (*Client) ListComments

func (c *Client) ListComments(ctx context.Context, issueKey string) ([]tracker.Comment, error)

ListComments implements tracker.Commenter.

func (*Client) ListFolderlessLists

func (c *Client) ListFolderlessLists(ctx context.Context, spaceID string) ([]List, error)

ListFolderlessLists lists all lists directly under a space (not inside a folder).

func (*Client) ListFolders

func (c *Client) ListFolders(ctx context.Context, spaceID string) ([]Folder, error)

ListFolders lists all folders in the given space.

func (*Client) ListIssues

func (c *Client) ListIssues(ctx context.Context, opts tracker.ListOptions) ([]tracker.Issue, error)

ListIssues implements tracker.Lister using GET /api/v2/list/{list_id}/task with pagination. Requires opts.Project to be set (= ClickUp list ID).

func (*Client) ListLists

func (c *Client) ListLists(ctx context.Context, folderID string) ([]List, error)

ListLists lists all lists in the given folder.

func (*Client) ListSpaces

func (c *Client) ListSpaces(ctx context.Context, teamID string) ([]Space, error)

ListSpaces lists all spaces in the workspace identified by teamID.

func (*Client) ListStatuses

func (c *Client) ListStatuses(ctx context.Context, key string) ([]tracker.Status, error)

ListStatuses implements tracker.StatusLister. Fetches the task to find its list ID, then fetches the list to get statuses.

func (*Client) ListWorkspaceMembers

func (c *Client) ListWorkspaceMembers(ctx context.Context, teamID string) ([]Member, error)

ListWorkspaceMembers lists all members of the workspace.

func (*Client) SetCustomField

func (c *Client) SetCustomField(ctx context.Context, taskID, fieldID string, value any) error

SetCustomField sets a custom field value on a task.

func (*Client) SetHTTPDoer

func (c *Client) SetHTTPDoer(doer apiclient.HTTPDoer)

SetHTTPDoer replaces the HTTP client used for API requests.

func (*Client) SetMarkdownDescription

func (c *Client) SetMarkdownDescription(ctx context.Context, key string, markdown string) error

SetMarkdownDescription updates the task's markdown description.

func (*Client) TeamID

func (c *Client) TeamID() string

TeamID returns the configured workspace/team ID.

func (*Client) TransitionIssue

func (c *Client) TransitionIssue(ctx context.Context, key string, targetStatus string) error

TransitionIssue implements tracker.Transitioner. ClickUp accepts the status name directly (no ID resolution needed).

type Config

type Config struct {
	Name        string   `mapstructure:"name"`
	URL         string   `mapstructure:"url"`
	Token       string   `mapstructure:"token"`
	TeamID      string   `mapstructure:"team_id"`
	Description string   `mapstructure:"description"`
	Role        string   `mapstructure:"role"`
	Safe        bool     `mapstructure:"safe"`
	Projects    []string `mapstructure:"projects"`
}

Config holds the configuration for a single ClickUp instance.

func LoadConfigs

func LoadConfigs(dir string) ([]Config, error)

LoadConfigs reads a .humanconfig YAML file from dir and returns the list of configured ClickUp instances. Returns nil and no error if the file does not exist.

type CustomFieldValue

type CustomFieldValue struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Type     string `json:"type"`
	Value    any    `json:"value"`
	Required bool   `json:"required"`
}

CustomFieldValue is a public representation of a custom field value on a task.

type Folder

type Folder struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Folder is a public ClickUp folder representation.

type List

type List struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

List is a public ClickUp list representation.

type Member

type Member struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
}

Member is a public ClickUp workspace member representation.

type Space

type Space struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Space is a public ClickUp space representation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL