//TODO repositoryAttributes (via aspect)
if (configuration!=null) {
IssuePriorities priorities = configuration.getIssuePriorities();
TaskAttribute attribute = getTaskData().getRoot().getAttribute(RedmineAttribute.PRIORITY.getTaskKey());
IssuePriority priority = priorities.getById(RedmineUtil.parseIntegerId(attribute.getValue()));
//some tickets references a non existing priority ?!
if (priority==null) {
priority = priorities.getDefault();
if(priority==null && priorities.getAll().size()>0) {
priority = priorities.getAll().get(0);
}
}
if (priority==null) {
PriorityLevel.fromLevel(1);
} else {
int pos = priority.getPosition();
level = PriorityLevel.fromLevel(pos>5 ? 1 : 6-pos);
}
}
return level;