3

引用了在 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 添加评论?

4

2 回答 2

1

我弄清楚了我在代码中的内容。我需要将评论作为 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())
于 2019-12-15T05:25:27.840 回答
0

您应该使用 Jira 的 REST API 来附加评论。请参阅此链接https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-add-comments-using-rest-api/qaq-p/571351

于 2017-06-12T11:23:32.057 回答