Skip to main content

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

FieldRequiredDescription
NameOptionalName of the step, should be unique within this workflow.
DescriptionOptionalDescribe the purpose or function of this step.
API VersionRequiredSpecify the version of the API to use.
OrganizationRequiredEnter the organization identifier.
ProjectRequiredEnter the project identifier.
File NameOptionalEnter the name of the file to upload.
Upload TypeOptionalSpecify the type of upload (e.g., single, batch).
Area PathOptionalEnter the area path for the upload.

File Name, Upload Type and Area Path are query parameters on the request.

Auth

FieldRequiredDescription
Auth TypeOptionalSelect the authentication method for the request. Options: No Auth, Basic, API Key, OAuth 2.
User NameOptionalUsername for Basic Authentication.
PasswordOptionalPassword 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.

FieldRequiredData TypeDescription
TargetRequiredObjectThe HTTP request.

The file content goes in the request body.

Output

The activity returns an httpResponse object.

FieldData TypeDescription
status.codeIntegerNumeric HTTP status code.
status.messageStringShort message associated with the HTTP status.
headersObjectHTTP response headers.
bodyObjectParsed body of the response — the created attachment reference.

The response body carries the attachment reference:

FieldData TypeDescription
idStringThe attachment identifier.
urlStringREST URL for the attachment.