Camel Components

ClickUp

Since Camel 4.9

This component is for receiving events from ClickUp.

Only consumer is supported

Maven users will need to add the following dependency to their pom.xml for this component.

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-clickup</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

URI format

clickup:workspaceId[?options]

Usage

The ClickUp component supports only webhook mode.

Examples

Webhook Mode

The ClickUp component supports usage in the webhook mode using the camel-webhook component.

To enable webhook mode, users need first to add a REST implementation to their application. Maven users, for example, can add netty-http to their pom.xml file:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-netty-http</artifactId>
</dependency>

In Java DSL:

Java-only: processing ClickUp webhook events with Java types and lambdas
from("webhook:clickup:<workspaceId>?&authorizationToken=<authorizationToken>&events=taskTimeTrackedUpdated")
                .choice()
                    .when(exchange -> exchange.getIn().getBody() instanceof TaskTimeTrackedUpdatedEvent)
                        .process(exchange -> {
                            TaskTimeTrackedUpdatedEvent event = exchange.getIn().getBody(TaskTimeTrackedUpdatedEvent.class);
                            LOG.info("TaskTimeTrackedUpdatedEvent {}", event);
                            exchange.getMessage().setBody(event);
                        })
                    .otherwise()
                        .log("Unknown Event: ${body}")
                .end();

In YAML, the is operator of the simple language checks the type of the event:

- route:
    from:
      uri: "webhook:clickup:{{clickup.workspace-id}}"
      parameters:
        authorizationToken: "{{clickup.authorization-token}}"
        events: taskTimeTrackedUpdated
      steps:
        - choice:
            when:
              - expression:
                  simple:
                    expression: "${body} is 'org.apache.camel.component.clickup.model.TaskTimeTrackedUpdatedEvent'"
                steps:
                  - log:
                      message: "TaskTimeTrackedUpdatedEvent ${body}"
            otherwise:
              steps:
                - log:
                    message: "Unknown Event: ${body}"

The events option accepts only taskTimeTrackedUpdated, the one kind with a class of its own, TaskTimeTrackedUpdatedEvent. A webhook set up in ClickUp itself (webhookAutoRegister=false) can send other kinds too: such an event reaches the route as a GenericEvent, where getEvent() gives the kind (such as taskCreated) and getProperties() the other fields of the JSON as they are. ClickUp gets 204 for it, as for any event the route processes without failing.

You can follow the set-up webhooks guide to enable and configure the webhook.