-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
7
-
1
-
It is common to have an LDAP directory that does not support incremental syncs and is moderately sized. These directories don't have the option to lower the sync interval to pick up group membership changes for known users, so admins currently have to trigger syncs from the UI if the sync interval is not an acceptable time to wait for the change to reach Jira. If the REST API had a means of triggering a sync remotely, it would give admins an easy (and scriptable) way to pick up changes to a directory.
Workaround
The Bash script below runs a directory sync of all enabled directories, be sure to update your credentials.
The script and its contents are not supported by Atlassian and are only provided on a best-effort basis. Use at your own risk.
#!/bin/bash set -x # we need the base URL of the app (ie: https://jira.domain.com) BASEURL=$1 [ -z "$BASEURL" ] && echo "usage: $0 BASEURL" && exit 1 # build the URL needed to grab the xtoken URL="$BASEURL/plugins/servlet/embedded-crowd/directories/list" # store the cookie as a temp file that is deleted as we finish COOKIE=/tmp/GetRest.$$ RESP=/tmp/GetToken.$$ # login and save the cookie curl -k -c $COOKIE -s -X POST \ --data 'os_username=your_admin_username' --data 'os_password=your_admin_password' --data "formname=loginform" --data "login='Log In'" \ "$BASEURL/dologin.action" -o /dev/null # get the list of sync opertaions by getting the URL with the cookie curl -k -b $COOKIE -s -X GET "$URL" > $RESP # here is an example of the sync operation # href="/plugins/servlet/embedded-crowd/directories/sync?directoryId=10501&atl_token=d5265f974829752eaa45a94011452b1b05f3f730"> # look for all of the available sync operations and call each one-by-one for i in `grep /sync $RESP | grep atl_token= | grep -v "{id}" | sed 's/^.*href="//; s/".$//'` ; do curl -k -b $COOKIE -s -X GET "$BASEURL$i" done # delete the temp files rm -f $COOKIE $TOKEN
- depends on
-
CWD-5029 Trigger Remote Directory Synchronization in Crowd via Remote API
- Future Consideration
- is related to
-
JRASERVER-67963 Allow to schedule the user directory synchronisation job
- Gathering Interest
- relates to
-
JRASERVER-77219 REST API for user directory operations
- Gathering Interest