2015-06-25 55 views
1

我已經通過文檔here,據此我正在爲JIRA創建一個問題。我知道我犯了一個非常小的錯誤。 我試圖創建命令行(以後我會在我的Java代碼集成) 新JIRA要求從我的Mac端我試圖運行:從命令行使用curl創建JIRA問題

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/ 

我相信這有事用「數據」做。 在此先感謝。這個例子來自文檔鏈接本身。

輸出:我沒有在我的終端,沒有錯誤,沒有預期的輸出。

PROJECTKEY取自我的儀表板中所有項目列表的KEY列。

+0

你需要把你的發佈數據放在單引號中 –

+0

你能舉個例子嗎?在此先感謝.. –

+0

'--data'{「fields」:.......}'' –

回答

1

有兩件事關:

  1. 你需要把你想在引號後的數據
  2. 第一雙引號周圍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/ 
+0

Z這可能是一個錯誤,謝謝..但現在我得到一個錯誤: { errorMessages「:[」找到的版本:找到的版本是必需的。「],」errors「:{}} 對此plss的任何幫助? –