REST API - Defining a Comment in the Request Body

Updated by Stefenie Stockbridge

When adding or updating a comment, you must specify the comment text in the request body.

Method

To submit information using the HTTP POST method instead of HTTP PATCH, you must add the following information to the request header to override the PATCH method:

X-HTTP-Method-Override: PATCH

Parameters

The following parameters must be specified within the Comment element:

  • Description : Write your comment in this element. Plain text formatting, HTML and inline styling are supported. If using HTML, the best practice is to use both <html> and <body> tags. External style sheets are not supported.
  • Status : Identifies the status of the comment. For example: open or closed.
Status values are configurable. You must specify a valid status value. You can obtain the status value of a comment via the Get Artifact request.

Examples

AddComment Example

Here is an example of a request body in XML format:

<?xml version="1.0" ?>
<Comment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blueprintsys.com/blueprint/api/v1">
<Description>Comment created by API</Description>
<Status>Open</Status>
</Comment>

Here is an example of a request body in JSON format:

{
"Status": "Open",
"Description": "Comment created by API"
}
UpdateComment Example

Here is an example of a request body in XML format:

<?xml version="1.0" ?>
<Comment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blueprintsys.com/blueprint/api/v1">
<Description>Comment created by API</Description>
<Status>Open</Status>
</Comment>

Here is an example of a request body in JSON format:

{
"Status": "Open",
"Description": "Comment created by API"
}


How did we do?