You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi experts,
I am trying to synchronize Jira and Confluence directories with an API call.
I wrote a powershell script but it is not working
$TLS12Protocol = [System.Net.SecurityProtocolType] 'Ssl3 , Tls12'
[System.Net.ServicePointManager]::SecurityProtocol = $TLS12Protocol$username = "toto"
$password = "xxxxx"
$baseurl = "https://myURL"# Configuration de l'en-tête de la requête
$headers = @{
"Content-Type" = "application/json"
#"Authorization" = "Basic"
}############### JIRA Synchro ##################
# Configuration de l'URL de l'API REST pour créer un projet
$jiraUrl = $baseurl + "/jira/plugins/servlet/embedded-crowd/directories/sync"
$directoryId = 10700# Configuration des données du projet pour l'envoi à l'API REST
$syncBody = @{
"directoryId" = $directoryId
} | ConvertTo-Json
# Envoi de la requête à l'API REST pour créer le projet
$responseJira = Invoke-RestMethod -Uri $jiraUrl -Method Post -Headers $headers -Body $syncBody -Credential (New-Object System.Management.Automation.PSCredential ($username, (ConvertTo-SecureString $password -AsPlainText -Force)))
I have an error 401 unauthorized
Do you have an idea ?
Hi @Rash ,
you can use JIRA as user management and syn users and groups in Confluence using a bultin feature (https://confluence.atlassian.com/doc/synchronizing-data-from-external-directories-229838498.html). Why don't you use this approach?
Fabio
Thanks for your answer;
I can't use this approch because we use Crowd as user management. I want to sync Jira and Confluence after creation of new groups in Crowd.
I know that sync can be scheduled every x minutes but i want to automate it.
My initial need is to automate creation of new project (Group creation in Crowd, Jira directory sync, Jira project creation, Configuration of permissions in Jira project, Confluence space creation, Configuration of permissions in Confluence space...)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.