Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,071
Community Members
 
Community Events
168
Community Groups

How to convert groovy into script runner rest end point

How to make this below groovy script to rest end point, so that i can call it externally as a JIRA rest api.

import com.atlassian.jira.bc.security.login.LoginService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.user.util.UserUtil

def result = ""

String groupname = "jira-administrators";
String username = "SVC-OneHygieia";

UserUtil userUtil = ComponentAccessor.userUtil;
userUtil.addUserToGroup(userUtil.getGroup(groupname) ,userUtil.getUser(username))
result = result + "Added " + username + " from " + groupname

result

 

Thanks,

Ipsita Dash

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events