引用在nuget包中找到的AnotherJiraClient代码
引用了此https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+示例+-+添加+注释添加评论。
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添加注释?
我弄清楚了代码中的内容。我需要将注释作为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())
您应该使用Jira的REST API来附加注释。查看此链接https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-add-comments-using-rest-api/qaq-p/571351