无法在jira中发布.json文件

时间:2018-08-09 14:39:50

标签: json bash jira jira-rest-api

添加目录链接后,我无法发布.json文件。

curl -s -D- -u uname:pword -X POST -d ${dir}@story_sp2.json -H "Content-Type: application/json" "https://jira.local.com/rest/api/2/issue/"

错误消息:

{"errorMessages":["Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)\n at [Source: org.apache.catalina.connector.CoyoteInputStream@1632e5dd; line: 1, column: 2]"]}

但是我可以在没有目录链接的情况下发布.json文件

curl -s -D- -u uname:pword -X POST -d @story_sp2.json -H "Content-Type: application/json" "https://jira.local.com/rest/api/2/issue/"

1 个答案:

答案 0 :(得分:1)

-d的格式不正确。 “ @”应位于“ $ {dir}”之前。此知识库中也提到过-https://confluence.atlassian.com/jirakb/unexpected-character-thrown-when-trying-to-perform-rest-calls-771895041.html

希望这会有所帮助。