ITask firstTask = tasks.get(0);
String repositoryUrl = firstTask.getRepositoryUrl();
if (repositoryUrl!=null && taskDataManager.hasTaskData(firstTask)) {
TaskData taskData = taskDataManager.getTaskData(firstTask);
TaskAttribute attribute = taskData.getRoot().getAttribute(RedmineAttribute.STATUS.getTaskKey());
Set<String> commonIds = new HashSet<String>(attribute.getOptions().keySet());
for (ITask task : tasks) {
if (task.getRepositoryUrl().equals(repositoryUrl)) { //Same-Repository-Policy
if (taskDataManager.hasTaskData(task)) {
taskData = taskDataManager.getTaskData(task);
attribute = taskData.getRoot().getAttribute(RedmineAttribute.STATUS.getTaskKey());
commonIds.retainAll(attribute.getOptions().keySet());
}
} else {
return null; //Same-Repository-Policy
}
}
if(commonIds.size()>0) {
statusMap = new HashMap<String, String>(commonIds.size());
for (String key : commonIds) {
statusMap.put(key, attribute.getOption(key));
}
}
}
}