URL:http://localhost:8080/rest/api/2/issue
body:
{
"fields":
{
"project":
{
"key": "DEMO"
},
"Epic Name": "Epic Name 01",
"summary": "REST EXAMPLE1",
"description":"Creating an Epic via REST",
"issuetype":
{
"name": "Epic"
}
}
}
如果未指定Content-type,Jira将返回415 Unsupported Media Type
。
添加到标题:
Content-Type: application/json
我尝试了这个并且奏效了:
{
"fields": {
"summary": "REST ye merry gentlemen.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"customfield_10104": "Epic Name 01",
"issuetype": {
"name": "Epic"
},
"project":
{
"key": "JIRA"
}
}
}
如果您想使用“ Epic Name”创建问题,则应使用其自定义字段ID进行引用。
要获取“史诗名称”自定义字段ID:请使用以下其余代码:
http://localhost:2990/jira/rest/api/2/customFields?search=Name%20of%20Epic