> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/documentation/automations/subworkflows/rewst-task-psa-cwm-upload-document-to-ticket.md).

# \[REWST - TASK] PSA-CWM: Upload Document to Ticket

This workflow provides a streamlined method for uploading documents to ConnectWise Manage tickets through API integration, serving as a reusable component that can be incorporated into larger automation processes whenever document attachments are required. MSPs will find this particularly valuable for automatically attaching diagnostic reports, compliance documentation, invoices, or remediation evidence to service tickets without manual intervention. Technically, the workflow executes an authenticated API request to ConnectWise Manage that uploads the specified document to a designated ticket, handling all the authentication and formatting requirements behind the scenes. This building block eliminates repetitive document handling tasks for technicians and ensures consistent documentation practices across client tickets.

This workflow contains 4 tasks.

### Inputs

* **record\_id** - string
* **attachment** - string
* **record\_type** - string
* **attachment\_name** - string

### Outputs

* **automation\_log**: Standardized Rewst automation log

### Key tasks

* **connect\_wise\_manage\_cwm\_api\_request**: ConnectWise PSA integration: CW PSA API Request
* **BEGIN**: Core integration: noop

### Jinja examples

#### Example 1

```jinja
{{CTX.record_id}}
```

Used in generating the multi-part form data.

#### Example 2

```jinja
{{CTX.attachment_name}}
```

Used in generating the multi-part form data.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rewst.help/documentation/automations/subworkflows/rewst-task-psa-cwm-upload-document-to-ticket.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
