Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×i am trying to create a small REST endpoint , please help
here is the small code i am working on. what am i missing ?
trying to add a user to a group
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.security.groups.GroupManager import com.atlassian.jira.user.ApplicationUser @BaseScript CustomEndpointDelegate delegate addUserToGroup(httpMethod: "PUT", groups: ["jira-administrators"]) { MultivaluedMap queryParams, String body, HttpServletRequest request -> GroupManager groupManager = ComponentAccessor.getGroupManager(); try { groupManager.addUserToGroup(((ApplicationUser) issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("ABCD"))).getDirectoryUser() , groupManager.getGroup("Group")) } catch (NullPointerException e){ }
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.