如何使用rest api向jira问题添加评论

时间:2013-12-13 12:18:40

标签: jira-rest-api

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

2 个答案:

答案 0 :(得分:0)

答案 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())