我想通过使用 JIRA 提供的 REST API 在 JIRA 中创建一个问题。我能够创建一个简单的问题,
使用这个:
http://localhost:8080/rest/api/latest/issue
和数据如下:
{"fields":{"project":{"key": "TES"},"summary":"user name not showing validation message","description":"Hi validation is missing from user name","issuetype": {"name": "Bug"},"reporter":{"name":"BruceWayne"} }}
这运行良好。
现在我想在创建问题时添加 3 个自定义字段。自定义字段是 Authorname、AuthorTag、AuthorID。我怎么能在rest api中做到这一点。我应该在我的数据中添加什么。
我的样本数据如下:-
{"fields":{"project":{"key": "TES"},"summary":"my bugs 5","description":"Hi","issuetype": {"name": "Bug"},
"customfield_10000":"roach@yahoo.com",
"customfield_10100":{"value":"abc"},
"reporter":{"name":"amit"},
"components": [{
"add" : {"name" : "abc"}
}],"priority": {
"id": "1"
}
}}
我想使用为 customfields 而不是 customfield_XXXXX 指定的名称。
我想到的一种方法是在创建一个简单的问题后点击 API(使用另一个 API 点击获取元数据,如下所示)
http://localhost:8080/rest/api/latest/issue/tes-79?expand=editmeta
然后进行 json 解析并再次发出 put 命令以更新同一问题中的字段
但我正在寻找一种在单个 API 命中的方法(同时创建问题)