@Override
public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData, Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException {
String taskId = taskData.getTaskId();
try {
IClient client = connector.getClientManager().getClient(repository);
Configuration cfg = connector.getRepositoryConfiguration(repository);
if(taskData.isNew() || taskId.isEmpty()) {
Issue issue = IssueMapper.createIssue(repository, taskData, oldAttributes, cfg);
taskId += client.createIssue(issue, monitor);
} else {
Issue issue = IssueMapper.createIssue(repository, taskData, oldAttributes, cfg);
TimeEntry timeEntry = IssueMapper.createTimeEntry(repository, taskData, oldAttributes, cfg);
TaskAttribute commentAttribute = taskData.getRoot().getAttribute(RedmineAttribute.COMMENT.getTaskKey());
String comment = commentAttribute==null ? null : commentAttribute.getValue();
client.updateIssue(issue, comment, timeEntry, monitor);
}
} catch (RedmineStatusException e) {
throw new CoreException(e.getStatus());
}