Help Center/ CodeArts Req/ API Reference/ API/ IPD Attachment Management/ Uploading Files and Associating Work Items
Updated on 2026-10-13 GMT+08:00

Uploading Files and Associating Work Items

Function

This API is used to upload an attachment to a work item in an IPD project. You can use the project ID and work item ID to associate a work item with a file.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartsreq:attachment:upload

Write

-

  • codeartsreq:Model

  • codeartsreq:ProjectId

-

-

URI

POST /v1/ipdprojectservice/projects/{project_id}/issues/{issue_id}/attachments/upload

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

32-character ID of a project, which must be unique. Obtain the value by calling the API for querying the IPD project list. The value of id in the response message body is the project ID.

Constraints

N/A

Range

A string of 32 characters consisting of letters and digits.

Default Value

N/A

issue_id

Yes

String

Definition

Unique ID of a work item. You can obtain the value from the Querying Work Items or Querying Tree-shaped Work Items API. The value is id in the response body.

Constraints

N/A

Range

A string of 18 to 19 digits.

Default Value

N/A

Request Parameters

Table 2 FormData parameters

Parameter

Mandatory

Type

Description

attachment

Yes

File

Definition

Attachment.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Definition

Response status.

Range

  • success: The response is successful.

  • error: The response fails.

message

String

Definition

Error message.

Range

N/A

result

Array of AttachmentVoExt objects

Definition

Attachment upload information. The array element is the AttachmentVoExt object.

Range

0 to 100 elements. Each element is an AttachmentVoExt object.

Table 4 AttachmentVoExt

Parameter

Type

Description

progress

Integer

Definition

Upload process.

Range

0 to 100

id

String

Definition

Attachment ID.

Range

A string of 18 to 19 digits.

workitem_id

String

Definition

Work item ID.

Range

A string of 18 to 19 digits.

store_filename

String

Definition

File name.

Range

0 to 256 characters.

associate_type

String

Definition

Association type.

Range

N/A

disk_directory

String

Definition

Relative path for storing the attachment on the server.

Range

0 to 1,024 characters.

type

String

Definition

Type.

Range

  • attachment: The metadata type is attachment.

category

String

Definition

Metadata type.

Range

  • Attachment: The metadata type is attachment.

issue_category

String

Definition

Work item type.

Range

0 to 32 characters.

status

String

Definition

Attachment status.

Range

0 to 32 characters.

description

String

Definition

Attachment description.

Range

N/A

modified_by

UserCommonVO object

Modifier information.

created_by

UserCommonVO object

Creator information.

domain_id

String

Definition

Project space ID.

Range

A string of 18 to 19 digits.

attachment_type

String

Definition

File type.

Range

0 to 32 characters.

created_date

String

Definition

Creation timestamp.

Range

13 to 19 characters.

storage_service

String

Definition

Name of the background service that processes the attachment.

Range

0 to 32 characters.

storage_id

String

Definition

Storage ID used in the database.

Range

0 to 32 characters.

delete_flag

Boolean

Definition

Whether the work item is deleted.

Range

  • false: not deleted.

  • true: deleted.

filesize

Long

Definition

File size, in bytes.

Range

0–104857600 (0–100 MB)

title

String

Definition

Actual name on the server.

Range

32 to 128 characters.

Table 5 UserCommonVO

Parameter

Type

Description

user_id

String

Definition

User ID.

Range

N/A

user_num_id

Integer

Definition

Short ID of a user.

Range

N/A

user_name

String

Definition

Username.

Range

N/A

domain_id

String

Definition

ID of the domain to which the user belongs.

Range

N/A

domain_name

String

Definition

Tenant name.

Range

N/A

nick_name

String

Definition

User alias.

Range

N/A

role_id

String

Definition

Role ID. If a user has multiple roles in a project, use commas (,) to separate the values.

Range

N/A

role_name

String

Definition

Role name. If a user has multiple roles, use commas (,) to separate the values.

Range

N/A

image_id

String

Definition

User avatar.

Range

N/A

region

String

Definition

Region to which a user belongs.

Range

N/A

watcher

Integer

Definition

Observer.

Range

N/A

opinion

String

Definition

Review information.

Range

N/A

description

String

Definition

Description.

Range

N/A

owner

String

Definition

Current handler.

Range

N/A

ccbId

String

Definition

Review object ID.

Range

N/A

status

Integer

Definition

Status.

Range

N/A

has_removed

String

Definition

Whether the user has been removed from the project.

Range

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Range

N/A

error_msg

String

Definition

Error description, which is a supplement to error_code.

Range

N/A

Example Requests

Assume that the project ID is gdbdf969b32694524a949b5ef6b3e124a and the work item ID is 956239067176935400. The following is an example of uploading an image attachment named demo.PNG to the work item:

POST https://{endpoint}/v1/ipdprojectservice/projects/gdbdf969b32694524a949b5ef6b3e124a/issues/956239067176935400/attachments/upload

------WebKitFormBoundary1kuNerRnRVVybt65
Content-Disposition: form-data; name="attachment"; filename="demo.PNG"
Content-Type: image/png

Example Responses

Status code: 200

{
  "status" : "success",
  "message" : "",
  "result" : [ {
    "progress" : 100,
    "id" : "1212813884362502144",
    "workitem_id" : "1212811957668290561",
    "associate_type" : null,
    "disk_directory" : "/projects/687a0637cf814b65b77b3e781af19ab2/attachments/6b570776a30844e7b6361f00c2a1a5bf.xlsx",
    "filesize" : "36449",
    "store_filename" : "TTT.xlsx",
    "title" : "6b570776a30844e7b6361f00c2a1a5bf.xlsx",
    "type" : "attachment",
    "category" : "Attachment",
    "issue_category" : null,
    "status" : null,
    "description" : null,
    "modified_by" : {
      "watcher" : null,
      "user_id" : "fcb28511450247ffbf78071035f9543c",
      "user_num_id" : 13369,
      "user_name" : "CodeArtsReq_GA2_MAX_Items",
      "domain_id" : "cdf72eb7297642da8c4b0dffe4f4f14b",
      "domain_name" : "CodeArtsReq_Test",
      "nick_name" : "CodeArtsReq_GA2_MAX_Items",
      "role_id" : null,
      "role_name" : null,
      "image_id" : null,
      "region" : null,
      "opinion" : null,
      "description" : null,
      "owner" : null,
      "ccbId" : null,
      "status" : 1,
      "has_removed" : null
    },
    "created_by" : {
      "watcher" : null,
      "user_id" : "fcb28511450247ffbf78071035f9543c",
      "user_num_id" : 13369,
      "user_name" : "CodeArtsReq_GA2_MAX_Items",
      "domain_id" : "cdf72eb7297642da8c4b0dffe4f4f14b",
      "domain_name" : "CodeArtsReq_Test",
      "nick_name" : "CodeArtsReq_GA2_MAX_Items",
      "role_id" : null,
      "role_name" : null,
      "image_id" : null,
      "region" : null,
      "opinion" : null,
      "description" : null,
      "owner" : null,
      "ccbId" : null,
      "status" : 1,
      "has_removed" : null
    },
    "domain_id" : "1212810843328520193",
    "attachment_type" : "xlsx",
    "created_date" : "1767086963022",
    "storage_service" : "IPDProjectService",
    "storage_id" : "6b570776a30844e7b6361f00c2a1a5bf",
    "delete_flag" : false
  } ]
}

Status code: 400

{
  "error_code" : "PM.02175145",
  "error_msg" : "The work item has been deleted."
}

Status Codes

Status Code

Description

200

Response to a successful request for uploading an attachment.

400

Response to the attachment upload failure, such as no operation permission and the work item has been deleted.

Error Codes

See Error Codes.