我試圖從我們的Atlassian Confluence/Jira實例中提取用戶列表。然而,我正在努力尋找關於哪些REST服務可用的良好文檔,並且似乎SOAP服務已被棄用。從Atlassian的Cloud/On-Demand服務獲取用戶列表
下面的代碼不會得到結果,但我們有超過100個用戶,而這個返回0
if(-not ($credentials)) { #put this here so I can rerun the same script in the same IDE session without having to reinput credentials each time
$credentials = get-credential 'myAtlassianUsername'
}
$tenant = 'myCompany'
invoke-restmethod -Method Get -Uri ('https://{0}.atlassian.net/rest/api/2/groupuserpicker?query=users' -f $tenant) -Credential $credentials | ConvertTo-Json -Depth 5
(該ConvertTo-Json
只是爲了更簡單地查看擴展的結果集)。
{
"users": {
"users": [
],
"total": 0,
"header": "Showing 0 of 0 matching users"
},
"groups": {
"header": "Showing 2 of 2 matching groups",
"total": 2,
"groups": [
{
"name": "confluence-users",
"html": "confluence-\u003cb\u003eusers\u003c/b\u003e",
"labels": [
]
},
{
"name": "jira-users",
"html": "jira-\u003cb\u003eusers\u003c/b\u003e",
"labels": [
]
}
]
}
}
我想結果試圖給我的JIRA和Confluence用戶API的URL;但我無法弄清楚這些相對URL如何映射到根URL(我嘗試在URL中的各個位置添加,所有這些都給了我一個404
或dead link
錯誤)。
根據Atlassian的(對於合流): XML-RPC和SOAP API的自V5.5棄用,但: XML-RPC不會被刪除,直到有足夠的覆蓋率匯合REST API,我們不贊成使用XML-RPC來指示應儘可能使用新代碼來使用rest api。您仍然可以在REST API逐步開發的同時使用RPC。 但是,列出所有用戶的調用在SOAP或REST API中不可用。在我們這邊,我們開發了自己的插件來公開這個函數。 – mtheriault