引用nuget包中找到的AnotherJiraClient代码
提到这一点 https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+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);
但总是返回状态未找到? 如何使用Jira REST API添加评论?
答案 0 :(得分:0)
您应该使用Jira的REST API附加评论。请参阅此链接https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-add-comments-using-rest-api/qaq-p/571351
答案 1 :(得分:0)
我弄清楚我在代码中发了什么。我需要将注释作为json对象提供。
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())