Interface OrganizationService


@PublicApi public interface OrganizationService
  • 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 check
      organizationId - 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 check
      parameters - parameters to create a new organization
      Returns:
      the organization
      Throws:
      ServiceDeskServiceException - on error
    • newCreateBuilder

    • delete

      void delete(@Nonnull com.atlassian.jira.user.ApplicationUser user, @Nonnull Integer organizationId)
      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 check
      organizationId - 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 check
      query - 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 Build UsersInOrganizationQuery
    • 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 query
      requestQuery - the query containing the pageRequest
      Returns:
      a paginated list of organizations
      Throws:
      ServiceDeskServiceException - on error
    • newOrganizationsQueryBuilder

      OrganizationsQuery.Builder newOrganizationsQueryBuilder()
      Returns:
      New OrganizationsQuery.Builder to build OrganizationsQuery
    • 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 organization
      organizationServiceDeskUpdateParameters - 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 organization
      organizationServiceDeskUpdateParameters - 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 check
      parameters - 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 check
      parameters - parameters containing the users to remove from the given organization
      Throws:
      ServiceDeskServiceException - on error
    • newUsersOrganizationUpdateParametersBuilder

      UsersOrganizationUpdateParameters.Builder newUsersOrganizationUpdateParametersBuilder()
      Returns:
      a new UsersOrganizationUpdateParameters.Builder to Build UsersOrganizationUpdateParameters