use of com.synopsys.integration.azure.boards.common.service.project.TeamProjectReferenceResponseModel in project hub-alert by blackducksoftware.
the class AzureCustomFieldManager method installCustomFields.
public void installCustomFields(String projectName, String workItemTypeName) throws AlertException {
List<Future<ProjectWorkItemFieldModel>> projectFieldFindOrCreateHolders = new ArrayList<>(7);
for (AzureCustomFieldDescriptor fieldDesc : AZURE_CUSTOM_FIELDS) {
Future<ProjectWorkItemFieldModel> fieldFindOrCreateHolder = executorService.submit(() -> findOrCreateAlertCustomProjectField(projectName, fieldDesc.getFieldName(), fieldDesc.getFieldReferenceName(), fieldDesc.getFieldDescription()));
projectFieldFindOrCreateHolders.add(fieldFindOrCreateHolder);
}
TeamProjectReferenceResponseModel project = getProject(projectName);
String processId = getProjectPropertyValue(project, ProjectPropertyResponseModel.COMMON_PROPERTIES_PROCESS_ID);
String workItemTypeRefName = getWorkItemTypeRefName(processId, workItemTypeName);
List<Future<ProcessFieldResponseModel>> processFieldAdditionHolders = new ArrayList<>(7);
for (Future<ProjectWorkItemFieldModel> projectFieldFuture : projectFieldFindOrCreateHolders) {
ProjectWorkItemFieldModel projectField = extractFutureResult(projectFieldFuture);
Future<ProcessFieldResponseModel> processFieldAdditionHolder = executorService.submit(() -> addAlertCustomFieldToProcess(processId, workItemTypeRefName, projectField));
processFieldAdditionHolders.add(processFieldAdditionHolder);
}
for (Future<ProcessFieldResponseModel> processFieldAdditionHolder : processFieldAdditionHolders) {
extractFutureResult(processFieldAdditionHolder);
}
}
use of com.synopsys.integration.azure.boards.common.service.project.TeamProjectReferenceResponseModel in project hub-alert by blackducksoftware.
the class AzureOAuthCallbackController method testGetProjects.
private void testGetProjects(AzureHttpService azureHttpService, String organizationName, String oAuthRequestKey) {
try {
AzureProjectService azureProjectService = new AzureProjectService(azureHttpService, new AzureApiVersionAppender());
AzureArrayResponseModel<TeamProjectReferenceResponseModel> projects = azureProjectService.getProjects(organizationName);
Integer projectCount = projects.getCount();
logger.info("OAuth request with id {}: Azure Boards project count: {}", oAuthRequestKey, projectCount);
} catch (HttpServiceException ex) {
logger.error("OAuth request with id {}: Error in azure oauth get projects validation test ", oAuthRequestKey, ex);
}
}
Aggregations