Item Comment Endpoint

Get

This method returns a comment of a specific Item.

Get/api/items/{itemid}/comments/{commentid}

The URL must have the Item Id and Comment Id. It returns a IssueCommentDto.

Microsoft.NET example:

IssueCommentDto itemComment = serviceManager.Item.IssueCommentGet(36, 103);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/comments/103";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey

$.ajax({
    url: geminiUrl,
    type: "GET",
    headers: { "Authorization": "Basic " + geminiUsername },
    success: function (data) {
      alert('Success!');
    }
});

Get All

This method returns all Comments of a specific Item.

Get/api/items/{itemid}/comments

It returns a list of IssueCommentDto's.

Microsoft.NET example:

List<IssueCommentDto> itemComments = serviceManager.Item.IssueCommentsGet(36);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/comments";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey

$.ajax({
    url: geminiUrl,
    type: "GET",
    headers: { "Authorization": "Basic " + geminiUsername },
    success: function (data) {
      alert('Success!');
    }
});

Create

This method creates a new Comment.

POST/api/items/{itemid}/comments

The request body must contain the IssueComment entity. The return value is a new IssueCommentDto where the IssueComment Id field is populated.

Microsoft.NET example:

var comment = new IssueComment();

comment.Comment = "This item was already done";
comment.ProjectId = 17;
comment.IssueId = 36;
comment.UserId = 1;

serviceManager.Item.IssueCommentCreate(comment);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/comments";
var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey

var geminiData = {
    ProjectId: "17",
    IssueId: "36",
    UserId: "1",
    Comment: "This item was already done"
}

$.ajax({
    url: geminiUrl,
    type: "POST",
    data: geminiData,
    headers: { "Authorization": "Basic " + geminiLogin },
    success: function (data) {
      alert('Success!');
    }
});

Update

This method updates an existing Comment.

PUT/api/items/{itemid}/comments

The request body must contain the IssueComment entity including the Id. The return value is the updated IssueCommentDto.

Microsoft.NET example:

IssueCommentDto data = new IssueCommentDto();

data.Entity.Id = 113;
data.Entity.Comment = "This item is still open";
data.Entity.ProjectId = 17;
data.Entity.IssueId = 36;
data.Entity.UserId = 1;

serviceManager.Item.IssueCommentCreate(data);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/comments";
var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey

var geminiData = {
    Id: "113"
    ProjectId: "17",
    IssueId: "36",
    UserId: "1",
    Comment: "This item is still open"
}

$.ajax({
    url: geminiUrl,
    type: "PUT",
    data: geminiData,
    headers: { "Authorization": "Basic " + geminiLogin },
    success: function (data) {
      alert('Success!');
    }
});

Delete

This method deletes a Comment

DELETE/api/items/{itemid}/comments/{commentid}

The URL must contain the Item Id and Comment Id.

Microsoft.NET example:

serviceManager.Item.IssueCommentDelete(36, 113);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/comments/113;
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey

$.ajax({
    url: geminiUrl,
    type: "DELETE",
    headers: { "Authorization": "Basic " + geminiUsername },
    success: function () {
      alert('Success!');
    }
});