Interface OrganizationService
@PublicApi
public interface OrganizationService
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOrganizationToServiceDesk
(com.atlassian.jira.user.ApplicationUser user, OrganizationServiceDeskUpdateParameters organizationServiceDeskUpdateParameters) Adds an organization to a service project if the user is an agent of that service project.void
addUsersToOrganization
(com.atlassian.jira.user.ApplicationUser executingUser, UsersOrganizationUpdateParameters parameters) Adds users to a specified organization.createOrganization
(com.atlassian.jira.user.ApplicationUser user, CreateOrganizationParameters parameters) Creates a new customer organization.void
Deletes a customer organization if the user is a Jira admin and an agent.Gets customer organization by ID if user is an agent or a member of the organization.getOrganizations
(com.atlassian.jira.user.ApplicationUser user, OrganizationsQuery requestQuery) Returns a list of organizations in the Jira instance based on query parameters.PagedResponse<com.atlassian.jira.user.ApplicationUser>
getUsersInOrganization
(com.atlassian.jira.user.ApplicationUser user, UsersInOrganizationQuery query) Gets all the applicationUsers in a given organization.Returns a newCreateOrganizationParameters.Builder
to buildCreateOrganizationParameters
void
removeOrganizationFromServiceDesk
(com.atlassian.jira.user.ApplicationUser user, OrganizationServiceDeskUpdateParameters organizationServiceDeskUpdateParameters) Removes an organization from a service project if the user is an agent of that service project.void
removeUsersFromOrganization
(com.atlassian.jira.user.ApplicationUser user, UsersOrganizationUpdateParameters parameters) Removes users from a specified organization.
-
Method Details
-
getById
CustomerOrganization getById(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull Integer organizationId) Gets customer organization by ID if user is an agent or a member of the organization. The user is an agent if they have a valid service project agent license.- Parameters:
user
- the user to checkorganizationId
- the ID of the organization to retrieve- Returns:
- the organization
- Throws:
ServiceDeskServiceException
- on error
-
createOrganization
CustomerOrganization createOrganization(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull CreateOrganizationParameters parameters) Creates a new customer organization. This method will check the JIRA settings first to see if the user needs to be an agent or a JIRA Administrator to create organizations- Parameters:
user
- the user to checkparameters
- parameters to create a new organization- Returns:
- the organization
- Throws:
ServiceDeskServiceException
- on error
-
newCreateBuilder
CreateOrganizationParameters.Builder newCreateBuilder()Returns a newCreateOrganizationParameters.Builder
to buildCreateOrganizationParameters
-
delete
Deletes a customer organization if the user is a Jira admin and an agent. The user is an agent if they have a valid service project agent license.- Parameters:
user
- the user who you want to checkorganizationId
- the ID of the organization you want delete.- Throws:
ServiceDeskServiceException
- on error
-
getUsersInOrganization
PagedResponse<com.atlassian.jira.user.ApplicationUser> getUsersInOrganization(@Nonnull com.atlassian.jira.user.ApplicationUser user, UsersInOrganizationQuery query) Gets all the applicationUsers in a given organization.- Parameters:
user
- the user to checkquery
- the query containing the organization and the pageRequest- Returns:
- a pagedResponse containing applicationUsers
- Throws:
ServiceDeskServiceException
- on error
-
newUsersInOrganizationQuery
UsersInOrganizationQuery.Builder newUsersInOrganizationQuery()- Returns:
- a new
UsersInOrganizationQuery.Builder
to BuildUsersInOrganizationQuery
-
getOrganizations
PagedResponse<CustomerOrganization> getOrganizations(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull OrganizationsQuery requestQuery) Returns a list of organizations in the Jira instance based on query parameters. If the user is not an agent, the resource returns a list of organizations the user is a member of.- Parameters:
user
- the user who performs a queryrequestQuery
- the query containing the pageRequest- Returns:
- a paginated list of organizations
- Throws:
ServiceDeskServiceException
- on error
-
newOrganizationsQueryBuilder
OrganizationsQuery.Builder newOrganizationsQueryBuilder()- Returns:
- New
OrganizationsQuery.Builder
to buildOrganizationsQuery
-
addOrganizationToServiceDesk
void addOrganizationToServiceDesk(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull OrganizationServiceDeskUpdateParameters organizationServiceDeskUpdateParameters) Adds an organization to a service project if the user is an agent of that service project.- Parameters:
user
- the user adding the organizationorganizationServiceDeskUpdateParameters
- contains the service project id and the organization- Throws:
ServiceDeskServiceException
- on error
-
removeOrganizationFromServiceDesk
void removeOrganizationFromServiceDesk(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull OrganizationServiceDeskUpdateParameters organizationServiceDeskUpdateParameters) Removes an organization from a service project if the user is an agent of that service project.- Parameters:
user
- the user removing the organizationorganizationServiceDeskUpdateParameters
- contains the service project id and the organization- Throws:
ServiceDeskServiceException
- on error
-
newOrganizationServiceDeskUpdateParametersBuilder
OrganizationServiceDeskUpdateParameters.Builder newOrganizationServiceDeskUpdateParametersBuilder()- Returns:
- a new
OrganizationServiceDeskUpdateParameters.Builder
to build OrganizationServiceDeskUpdateParameters parameters
-
addUsersToOrganization
void addUsersToOrganization(@Nonnull com.atlassian.jira.user.ApplicationUser executingUser, @Nonnull UsersOrganizationUpdateParameters parameters) Adds users to a specified organization.- Parameters:
executingUser
- the user who you want to checkparameters
- the parameters containing the organization and users to add- Throws:
ServiceDeskServiceException
- on error
-
removeUsersFromOrganization
void removeUsersFromOrganization(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull UsersOrganizationUpdateParameters parameters) Removes users from a specified organization.- Parameters:
user
- the user who you want to checkparameters
- parameters containing the users to remove from the given organization- Throws:
ServiceDeskServiceException
- on error
-
newUsersOrganizationUpdateParametersBuilder
UsersOrganizationUpdateParameters.Builder newUsersOrganizationUpdateParametersBuilder()- Returns:
- a new
UsersOrganizationUpdateParameters.Builder
to BuildUsersOrganizationUpdateParameters
-