如果新客户不存在,我想创建新客户,并使用 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 问题?你可以帮帮我吗?
1 回答
largeQ
TA贡献2039条经验 获得超7个赞
通过 REST,我设法使用name参数而不是fullname.
"fields": {
"project": {
"key": "AP"
},
"summary": "test",
"description": "test",
"reporter": {
"name": "kamilszmit2"
},
"issuetype": {
"id": "10108"
}
我要检查的其他事项:
报告者字段被添加到创建问题屏幕
这些调用运行时使用的凭据,具有修改报告器 项目权限(如果他们没有此权限,您将遇到 405 错误)
- 1 回答
- 0 关注
- 111 浏览
添加回答
举报
0/150
提交
取消