Share this page

# POST: Create a comment

This topic provides instructions for using the POST operation to add a comment.

In this topic:

## Overview

To create a comment instance, perform a POST on the comment collection, passing a JSON string. When posting the comment, you assign the comment to an instance, such as a defect.

Even though a comment is a field of an entity, you create the comment and assign it to the entity. You do not create the entity and add a comment to it.

Bulk POSTs are not supported.

Seeing comments

For performance optimization, when GETting other entities, comments are not included by default in the response. To see a list of comment IDs and types, you have to explicitly request them using the fields clause.

`GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/defects&fields=comments`

Back to top

## Examples

Add a comment to a defect with ID 1048

    *** Request ***

    POST .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/comments

    {

        "data": [

        {  "author":

            {   "id":"1001",

                 "type":"workspace_user"

            },

           "text":"my new comment",

           "owner_work_item":

           {

              "id":"1024",

              "type":"defect"

           }

       }

      ]

    }

    *** Response ***

    {
      "total_count": 1,
      "data": [
        {
          "type": "comment",

          "id": "1001"
        }
      ],
      "exceeds_total_count": false
    }

Back to top

See also:

- Attachments

https://admhelp.microfocus.com ALM Octane 8942
Tips to improve your search results... ValueEdge & ALM Octane Help Center ValueEdge ALM Octane Help 16.0.100-16.0.400 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: