Comments

Manage comments in TeamPulse.

GET /comments/{id} - Get a comment by ID

GET /comments - Get all comments for the work items to which the user has access to.

GET /comments/{commentId}/attachments - Get the attachments for a comment

GET /workitems/{workItemId}/comments - Get all comments for a work item

POST /comments - Create a comment

DELETE /comments/{id} - Delete a comment

Comment Model

The object representing a comment has the following properties:

id: integer (Read-only) - ID of the comment.

projectId: integer (Required, Read-only) - ID of the project to which this comment belongs to.

workItemId: integer (Required, Read-only) - ID of the work item to which the comment belongs to.

description: string (Required) - Comment description.

type: string - Comment type. Valid values are "TeamPulse" and "Feedback". Default value is "TeamPulse".

createdBy: string - The name of the user who created the comment

createdAt: DateTime - The date when the comment is created

lastModifiedBy: string - The name of the user who last modified the comment

lastModifiedAt: DateTime - The date when the comment is last modified

Resource Url

To make API requests use the URL [teampulse]/api/v1 where [teampulse] is the URL to the TeamPulse instance which you want to manage via the API.

Example:
[teampulse]/api/v1/comments

Get a comment

GET /comments/{id}

Response

HTTP/1.1 200

{
    "id": 1,
    "projectId": 1,
    "workItemId": 100,
    "description": "Sample comment",
    "type": "TeamPulse",        
    "createdBy": "Paul Smith",
    "createdAt": "2013-06-20T10:10:00",
    "lastModifiedBy": "Paul Smith",
    "lastModifiedAt": "2013-06-20T11:45:00"
}

Get comments

GET /comments : Get all comments for the work items to which the user has access to.

GET /workitems/{workItemId}/comments : Get all comments for a work item

OData $filter and $orderby options can be supp lied to filter and order the results. $top and $skip to get top N items and skip the top M. Read more how to use the OData options

Response

HTTP/1.1 200

{
  "totalResults": 3,
  "top": 3,
  "results": [
    {
        "id": 1,
        "projectId": 1,
        "workItemId": 100,
        "description": "Sample comment 1",
        "type": "TeamPulse",            
        "createdBy": "Paul Smith",
        "createdAt": "2013-06-20T10:10:00",
        "lastModifiedBy": "Paul Smith",
        "lastModifiedAt": "2013-06-20T11:45:00"
    },
    {
        "id": 2,
        "projectId": 1,
        "workItemId": 100,
        "description": "Sample comment 2",
        "type": "TeamPulse",
        "createdBy": "Paul Smith",
        "createdAt": "2013-06-20T10:10:00",
        "lastModifiedBy": "Paul Smith",
        "lastModifiedAt": "2013-06-20T11:45:00"
    },
    {
        "id": 3,
        "projectId": 1,
        "workItemId": 100,
        "description": "Sample comment 3",
        "type": "TeamPulse",
        "createdBy": "Paul Smith",
        "createdAt": "2013-06-20T10:10:00",
        "lastModifiedBy": "Paul Smith",
        "lastModifiedAt": "2013-06-20T11:45:00"
    }
  ]
}

Create a comment

POST /comments

Request

{
    "projectId": 1,
    "workItemId": 100,
    "description": "Sample comment",
    "type": "TeamPulse"
}

Response

HTTP/1.1 201

{
    "id": 1,
    "projectId": 1,
    "workItemId": 100,
    "description": "Sample comment",
    "type": "TeamPulse",
    "createdBy": "Paul Smith",
    "createdAt": "2013-06-20T10:10:00",
    "lastModifiedBy": "Paul Smith",
    "lastModifiedAt": "2013-06-20T10:10:00"
}

Delete a comment

DELETE /comments/{id}

Response

HTTP/1.1 200