问题
Refered AnotherJiraClient code found in nuget package
Refered this https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+Comment to add a comment.
var request = new RestRequest()
{
Resource = ResourceUrls.Comment(),
RequestFormat = DataFormat.Json,
Method = Method.POST
};
request.AddBody(addComment);//{"body":"Something"}
return Execute<BasicIssue>(request, HttpStatusCode.Created);
But always returned with status not found? How to add comments using Jira REST API?
回答1:
You should use Jira's REST API to append a comment . See this link https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-add-comments-using-rest-api/qaq-p/571351
回答2:
I figured out what was I mssing in the code. I need to provide the comment as an json object.
library(httr)
library(RJSONIO)
x <- toJSON(list(body = "Adding a new Comment"))
POST("https://xxxxxx.atlassian.net/rest/api/2/issue/{issueIdOrKey}/comment",body = x, authenticate(userid,password, "basic"), add_headers("Content-Type" = "application/json"), verbose())
来源:https://stackoverflow.com/questions/20566363/how-to-add-a-comments-to-jira-issue-using-rest-api