2017-03-15 39 views

回答

1

嗯,在JIRA客戶端是用ES6,這我沒那麼熟悉,但我認爲searchUsers函數實際上期望一個對象參數,而不是一個列表。

searchUsers({ username, startAt, maxResults, includeActive, includeInactive }) { ... } 

{username, startAt...}是解構賦值從一個傳遞的對象拉鍵名,並把它們轉化成變量。根據函數的註釋,您應該傳遞一個選項對象。 請嘗試像這樣:

jira.searchUsers({username: "jane.doe"}).then((user) -> 
    console.log(user.length) 
).catch (err) -> 
    console.error err 
+0

是的,現在你明白了!謝謝 –