如果新客户不存在,我想创建新客户,并使用 Jira API创建新问题,将此客户设置为PHP 中的报告者。
我使用带有 POST 字段“fullName”和“email”的 API 'servicedeskapi/customer' 创建新客户,然后我使用带有参数 'reporter' 的参数 'fullName' 和 'email' 的 API 'api/2/issue' 创建新问题.
如果客户不存在,则响应为:
{
"name": "kamilszmit2@live.com",
"key": "kamilszmit2@live.com",
"emailAddress": "kamilszmit2@live.com",
"displayName": "kamilszmit2",
"active": true,
"timeZone": "Europe\/Warsaw",
"_links": {
"jiraRest": "https:\/\/jira-address\/rest\/api\/2\/user?username=kamilszmit2%40live.com",
"avatarUrls": {
"48x48": "https:\/\/jira-address\/secure\/useravatar?avatarId=10122",
"24x24": "https:\/\/jira-address\/secure\/useravatar?size=small&avatarId=10122",
"16x16": "https:\/\/jira-address\/secure\/useravatar?size=xsmall&avatarId=10122",
"32x32": "https:\/\/jira-address\/secure\/useravatar?size=medium&avatarId=10122"
},
"self": "https:\/\/jira-address\/rest\/api\/2\/user?username=kamilszmit2%40live.com"
}
}{
"fields": {
"project": {
"key": "AP"
},
"summary": "test",
"description": "test",
"reporter": {
"fullName": "kamilszmit2",
"email": "kamilszmit2@live.com"
},
"issuetype": {
"id": "10108"
}
}
}{
"id": "11187",
"key": "AP-351",
"self": "https:\/\/jira-address\/rest\/api\/2\/issue\/11187"
}
客户和问题已创建,但客户未设置为问题的报告者。如果客户已经存在并且仅使用参数“reporter”的参数“fullName”或“email”,则会出现同样的问题。
我究竟做错了什么?如何以客户为报告者创建 Jira 问题?你可以帮帮我吗?
largeQ