I would like to set the organisation for a user on a transition.
Using the organisation linked to an issue then I want to assign the same organisation to a customer.
I am attempting to use this function but cannot get it working, I know its not right any assistance would be greatly appreciated
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def cfOrganisation = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Organizations")
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cfUserPicker = customFieldManager.getCustomFieldObject(11901L)
def organisation = issue.getCustomFieldValue(cfOrganisation)
ApplicartionUser user = issue.getCustomFieldValue(cfUserPicker)
UsersOrganizationUpdateParameters param = organizationService.newUsersOrganizationUpdateParameters().customerOrganisation(organisation).users(newUser).build()
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot