从命令行使用 curl 创建 JIRA 问题
Creating JIRA issue using curl from command line
我已经阅读了文档 here,据此我正在为 JIRA 创建问题。我知道我犯了一些非常小的错误。
我正在尝试从命令行创建一个新的 JIRA 请求(稍后我将集成到我的 java 代码中)
从我的 Mac 终端,我正在尝试 运行 :
curl -D- -u username:password -X POST --data {"fields":{"project":{"key": “PROJECTKEY"},"summary": "REST ye merry gentlemen.","description": "Creating of an issue using project keys and issue type names using the REST API","issuetype": {"name": "Bug"}}} -H "Content-Type: application/json" https://mycompanyname.atlassian.net/rest/api/2/issue/
我相信这与 "data" 有关。
提前致谢。该示例取自文档 link 本身。
输出:我的终端没有任何结果,没有错误,没有预期的输出。
PROJECTKEY 取自我的 DASHBOARD 中所有项目列表的 KEY 列。
有两件事不对:
- 您需要将要 post 的数据放在引号中
- PROJECT_KEY 周围的第一个双引号是 unicode 字符而不是常规双引号,因此将
“PROJECTKEY"
更改为 "PROJECTKEY"
这应该有效:
curl -D- -u username:password -X POST --data '{"fields":{"project":{"key": "PROJECTKEY"},"summary": "REST ye merry gentlemen.","description": "Creating of an issue using project keys and issue type names using the REST API","issuetype": {"name": "Bug"}}}' -H "Content-Type: application/json" https://mycompanyname.atlassian.net/rest/api/2/issue/
我已经阅读了文档 here,据此我正在为 JIRA 创建问题。我知道我犯了一些非常小的错误。 我正在尝试从命令行创建一个新的 JIRA 请求(稍后我将集成到我的 java 代码中) 从我的 Mac 终端,我正在尝试 运行 :
curl -D- -u username:password -X POST --data {"fields":{"project":{"key": “PROJECTKEY"},"summary": "REST ye merry gentlemen.","description": "Creating of an issue using project keys and issue type names using the REST API","issuetype": {"name": "Bug"}}} -H "Content-Type: application/json" https://mycompanyname.atlassian.net/rest/api/2/issue/
我相信这与 "data" 有关。 提前致谢。该示例取自文档 link 本身。
输出:我的终端没有任何结果,没有错误,没有预期的输出。
PROJECTKEY 取自我的 DASHBOARD 中所有项目列表的 KEY 列。
有两件事不对:
- 您需要将要 post 的数据放在引号中
- PROJECT_KEY 周围的第一个双引号是 unicode 字符而不是常规双引号,因此将
“PROJECTKEY"
更改为"PROJECTKEY"
这应该有效:
curl -D- -u username:password -X POST --data '{"fields":{"project":{"key": "PROJECTKEY"},"summary": "REST ye merry gentlemen.","description": "Creating of an issue using project keys and issue type names using the REST API","issuetype": {"name": "Bug"}}}' -H "Content-Type: application/json" https://mycompanyname.atlassian.net/rest/api/2/issue/