gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 18:08:26 26 4
gpt4 key购买 nike

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

最佳答案

我弄清楚了我在代码中遗漏了什么。我需要以 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 - 如何使用 rest api 向 jira 问题添加评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20566363/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com