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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.