private RepositoryResponse insertIssue(TaskRepository repository, TaskData taskData,
IProgressMonitor monitor) throws CoreException {
IGoogleCodeClient client = getClient(repository);
IssuesEntry entry = new IssuesEntry();
entry.addLabel(new Label(getPriority(taskData)));
String summary = getStringValue(taskData, GoogleCodeAttribute.SUMMARY);
String description = getStringValue(taskData, GoogleCodeAttribute.DESCRIPTION_NEW);
entry.getAuthors().add(client.getCurrentUser());
String ownerName = getStringValue(taskData, GoogleCodeAttribute.USER_ASSIGNED);
if (!StringUtils.isEmpty(ownerName)) {
Owner owner = new Owner();
owner.setUsername(new Username(ownerName));
entry.setOwner(owner);
}
entry.setContent(new HtmlTextConstruct(description));
entry.setTitle(new PlainTextConstruct(summary));
entry.setStatus(new Status("New"));
entry.setSendEmail(new SendEmail("False"));
IssuesEntry created = client.createIssue(entry, monitor);
String issueId = getIssueId(created);
return new RepositoryResponse(ResponseKind.TASK_CREATED, issueId);
}