REST API - Move Artifact Request

Updated by Stefenie Stockbridge

api/v1/projects/{projectId}/artifacts/{artifactId}/traces

Description

In order to move an artifact, you must change the parent of the artifact. By changing the parent, you are effectively moving the specified artifact and its descendants to a new location in the hierarchy.

Artifacts with read-only traces cannot be moved.

URL Structure

[Blueprint_URI]/api/v1/projects/{ProjectId}/artifacts/{ArtifactId}/traces
  • ProjectId: The ID of the project that contains the artifact you want to move.
  • ArtifactId: The ID of the artifact you want to move.

Supported Methods

Request Body

The new parent artifact must be specified in the request body. Read more about how to specify the parent artifact in the request body.

Blueprint Result Codes

Your response may contain ResultCode and Message parameters if your request involves changes to Blueprint data. These parameters provide detailed information about the result of your request.

  • 200 (OK)
    • The artifact updated successfully.
  • 400 (Bad Request)
  • 414 (Locked by Another User)
    • Artifact is locked by another user.
    • Cannot check out the artifact.
  • 428 (New Parent Is Current One)
    • The newly specified parent is already the current parent.
  • 429 (New Parent Not Found For User)
    • The newly specified parent cannot be found for the user.
  • 430 (New Parent Not In Project)
    • The newly specified parent is from another project. Moving the artifact across projects is not supported.
  • 431 (No Edit Permission On New Parent)
    • Cannot make the specified artifact the new parent. The user does not have edit permissions for the new parent.
  • 432 (New Parent Is Descendent Or Itself)
    • The newly specified parent is either a descendent of the artifact or is the same artifact ID that was specified in the URL.
  • 500: Internal Server Erro

HTTP Status Codes

  • 200: OK
  • 201: Successfully Created
  • 206: Partial Content
  • 400: Bad Request
    This error can occur for a variety of reasons:
    • At least one URI or request body parameter is invalid, such as one of the Filter, Traces, Offset or Limit parameters.
    • A required value has not been provided.
    • If you are submitting a POST or PATCH request and have not added the X-HTTP-Method-Override parameter to your request header.
  • 401: Unauthorized
    • The Blueprint token is missing, invalid or expired.
  • 403: Forbidden
    • The applicable permissions are needed. For example, this error can occur when:
      • An Author or Collaborate license is needed for access.
      • Comment permissions are needed on the artifact.
      • Edit permissions are needed on the change summary job.
  • 404: NotFound
    • Item is not found in the project. For example, this error can occur when:
      • Artifact not found.
      • Artifact type not found.
      • Project not found.
      • ALM target not found.
      • Change summary job not found.
      • User does not have edit permissions for this artifact, project or ALM target.
  • 409: Conflict
    • Reason for failure can be found in the response body. Additional information may also be found in the log.
  • 411: Length Required
    • If the Content-Length header is missing in the request.
  • 413: Request Entity Too Large
    • If the provided file size is larger than allowed.
  • 415: Unsupported Media Type
    • If the provided media type is not of MIME Multipart Content "form-data."
  • 416: Request Range Not Satisfiable
    • If offset points to a part of a collection that is not available.
  • 500: Internal Server Error
  • 501: Not Implemented

Examples

XML Example

Request URI

https://blueprintcloud.com/api/v1/projects/847739/artifacts/888020/traces

Request Body

<?xml version="1.0" ?>			
<Traces xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blueprintsys.com/blueprint/api/v1">
<Trace>
<ArtifactId>999666</ArtifactId>
<Type>Parent</Type>
</Trace>
</Traces>

Response Body

<?xml version="1.0" ?>
<TraceUpdateResults xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blueprintsys.com/blueprint/api/v1">
<TraceUpdateResult>
<ArtifactId>999666</ArtifactId>
<Message>The parent of the artifact has been successfully updated.</Message>
<ResultCode>200</ResultCode>
<Type>Parent</Type>
</TraceUpdateResult>
</TraceUpdateResults>
JSON Example

Request URI

https://blueprintcloud.com/api/v1/projects/847739/artifacts/888020/traces

Request Body

[
{
"Type": "Parent",
"ArtifactId": 999666
}
]

Response Body

[
{
"ArtifactId": 999666,
"Type": "Parent",
"Message": "The parent of the artifact has been successfully updated.",
"ResultCode": 200
}
]


How did we do?