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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.