Create Attachment
CreateAttachment uploads an attachment, which can then be linked to a work item.
It calls POST https://dev.azure.com/{organization}/{project}/_apis/wit/attachments.
The activity has four tabs: Configuration, Auth, Input, and Output.
Configuration
| Field | Required | Description |
|---|---|---|
| Name | Optional | Name of the step, should be unique within this workflow. |
| Description | Optional | Describe the purpose or function of this step. |
| API Version | Required | Specify the version of the API to use. |
| Organization | Required | Enter the organization identifier. |
| Project | Required | Enter the project identifier. |
| File Name | Optional | Enter the name of the file to upload. |
| Upload Type | Optional | Specify the type of upload (e.g., single, batch). |
| Area Path | Optional | Enter the area path for the upload. |
File Name, Upload Type and Area Path are query parameters on the request.
Auth
| Field | Required | Description |
|---|---|---|
| Auth Type | Optional | Select the authentication method for the request. Options: No Auth, Basic, API Key, OAuth 2. |
| User Name | Optional | Username for Basic Authentication. |
| Password | Optional | Password for Basic Authentication. |
Input
This activity is built on the REST Client, so the Input tab is the generic HTTP request rather than an Azure Boards-shaped payload.
| Field | Required | Data Type | Description |
|---|---|---|---|
| Target | Required | Object | The HTTP request. |
The file content goes in the request body.
Output
The activity returns an httpResponse object.
| Field | Data Type | Description |
|---|---|---|
| status.code | Integer | Numeric HTTP status code. |
| status.message | String | Short message associated with the HTTP status. |
| headers | Object | HTTP response headers. |
| body | Object | Parsed body of the response — the created attachment reference. |
The response body carries the attachment reference:
| Field | Data Type | Description |
|---|---|---|
| id | String | The attachment identifier. |
| url | String | REST URL for the attachment. |