if my Jira server user Directory is using LDAP. What will be the best way to :
getUserByName("A"),
addUserToGroup(user,group)
error:
"message":"org.springframework.transaction.CannotCreateTransactionException: Could not create DirContext instance for transaction; nested exception is org.springframework.ldap.CommunicationException
Root exception is java.lang.ClassNotFoundException: com.atlassian.crowd.directory.ssl.LdapHostnameVerificationSSLSocketFactory
Try this...
import com.atlassian.jira.component.ComponentAccessor
def username = "user1"
def group ="groupA"
def addtouser = ComponentAccessor.getUserManager().getUserByName(username)
def grouptoadd = ComponentAccessor.getUserManager().getGroup(group)
ComponentAccessor.groupManager.addUserToGroup(addtouser,grouptoadd)
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.