Hi
I wrote script that should return all organizations with their users in any Service desk project,but this script return 50 organization in any project:
ArrayList<CustomerOrganization> getAllOrganizationInProject (Project pr)
{
def serviceDeskManager = ComponentAccessor.getOSGiComponentInstanceOfType(ServiceDeskManager)
def organizationService = ComponentAccessor.getOSGiComponentInstanceOfType(OrganizationService)
ApplicationUser jiraAutamticOperationUser = ComponentAccessor.userManager.getUserByName("JiraAutomaticOperation") as ApplicationUser;
ArrayList<CustomerOrganization> customerOrganization = new ArrayList<CustomerOrganization>();
def serviceDeskProjectResult = serviceDeskManager.getServiceDeskForProject(pr);
def serviceDeskId = serviceDeskProjectResult.getId();
def organizationQuery = organizationService.newOrganizationsQueryBuilder().serviceDeskId(serviceDeskId).build()
def organizationsResult = organizationService.getOrganizations(jiraAutamticOperationUser,organizationQuery)
/* PagedResponse<CustomerOrganization> organizations1 =
(PagedResponse<CustomerOrganization>)organizationsResult.getResults()
organizations1.each { a-> log.error "organizations1= "+ a.getName() }
*/
organizationsResult.getResults().each {
organization -> customerOrganization.add(organization);
}
customerOrganization.each { c-> log.error "customerOrganization= "+ c.name }
return customerOrganization
How do I fix it?
I want all organizations (in all page) of any service desk project.
thanks