查询包含空格时如何通过REST API检索Jira问题

时间:2018-12-03 20:30:01

标签: jira-rest-api

我正在尝试从项目中检索所有状态为“新故障单”的问题。带有空格的状态名称完全使我震惊。

我的命令如下所示。如果状态是一个单词,如Object.prototype.test = {val: 5, abc: 8}; Array.prototype.test = Object.create(Object.prototype.test) Array.prototype.test.abc = 20; console.log(([]).test.abc); // shadows with it's own abc Object.prototype.test.abc = 500 // changes in object have no effect console.log(([]).test.abc); // still 20 console.log(([]).test.val); // no val on Array's test so it defers to object prototype Object.prototype.test.val = 100 // changing object changes array console.log(([]).test.val); ,但在Closed中的间距上失败,则此方法非常有效。

New Ticket

我尝试以下操作均未成功;

curl -D- \
  -u user:password \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jql":"project = DEVOPS AND status = New Ticket", "fields":["id","key","summary","description"]}' \
  "https://projecturl.atlassian.net/rest/api/2/search"

什么是正确的语法?

1 个答案:

答案 0 :(得分:1)

经过一堆混乱之后,事实证明您可以像这样在查询中转义引号;

"project = DEVOPS AND status = \"New Ticket\""