Lines 50-55
Link Here
|
50 |
import org.eclipse.mylyn.internal.jira.core.model.JiraWorkLog; |
50 |
import org.eclipse.mylyn.internal.jira.core.model.JiraWorkLog; |
51 |
import org.eclipse.mylyn.internal.jira.core.model.Priority; |
51 |
import org.eclipse.mylyn.internal.jira.core.model.Priority; |
52 |
import org.eclipse.mylyn.internal.jira.core.model.Project; |
52 |
import org.eclipse.mylyn.internal.jira.core.model.Project; |
|
|
53 |
import org.eclipse.mylyn.internal.jira.core.model.ProjectRole; |
53 |
import org.eclipse.mylyn.internal.jira.core.model.Resolution; |
54 |
import org.eclipse.mylyn.internal.jira.core.model.Resolution; |
54 |
import org.eclipse.mylyn.internal.jira.core.model.SecurityLevel; |
55 |
import org.eclipse.mylyn.internal.jira.core.model.SecurityLevel; |
55 |
import org.eclipse.mylyn.internal.jira.core.model.Subtask; |
56 |
import org.eclipse.mylyn.internal.jira.core.model.Subtask; |
Lines 279-284
Link Here
|
279 |
} |
280 |
} |
280 |
|
281 |
|
281 |
data.getRoot().createAttribute(WorkLogConverter.ATTRIBUTE_WORKLOG_NEW); |
282 |
data.getRoot().createAttribute(WorkLogConverter.ATTRIBUTE_WORKLOG_NEW); |
|
|
283 |
|
284 |
TaskAttribute projectRoles = createAttribute(data, JiraAttribute.PROJECT_ROLES); |
285 |
projectRoles.putOption(IJiraConstants.NEW_COMMENT_VIEWABLE_BY_ALL, IJiraConstants.NEW_COMMENT_VIEWABLE_BY_ALL); |
286 |
for (ProjectRole projectRole : client.getCache().getProjectRoles()) { |
287 |
projectRoles.putOption(projectRole.getName(), projectRole.getName()); |
288 |
} |
289 |
|
282 |
} |
290 |
} |
283 |
|
291 |
|
284 |
public TaskAttribute createAttribute(TaskData data, JiraAttribute key) { |
292 |
public TaskAttribute createAttribute(TaskData data, JiraAttribute key) { |
Lines 448-453
Link Here
|
448 |
removeAttribute(data, JiraAttribute.ENVIRONMENT); |
456 |
removeAttribute(data, JiraAttribute.ENVIRONMENT); |
449 |
} |
457 |
} |
450 |
|
458 |
|
|
|
459 |
addAttributeValue(data, JiraAttribute.PROJECT_ROLES, IJiraConstants.NEW_COMMENT_VIEWABLE_BY_ALL); |
460 |
|
451 |
addComments(data, jiraIssue, client); |
461 |
addComments(data, jiraIssue, client); |
452 |
addAttachments(data, jiraIssue, client); |
462 |
addAttachments(data, jiraIssue, client); |
453 |
addCustomFields(data, jiraIssue); |
463 |
addCustomFields(data, jiraIssue); |
Lines 599-605
Link Here
|
599 |
|
609 |
|
600 |
if (TaskAttribute.COMMENT_NEW.equals(attribute.getId()) |
610 |
if (TaskAttribute.COMMENT_NEW.equals(attribute.getId()) |
601 |
|| TaskAttribute.RESOLUTION.equals(attribute.getId()) |
611 |
|| TaskAttribute.RESOLUTION.equals(attribute.getId()) |
602 |
|| TaskAttribute.USER_ASSIGNED.equals(attribute.getId())) { |
612 |
|| TaskAttribute.USER_ASSIGNED.equals(attribute.getId()) |
|
|
613 |
|| IJiraConstants.ATTRIBUTE_PROJECT_ROLES.equals(attribute.getId())) { |
603 |
properties.setReadOnly(false); |
614 |
properties.setReadOnly(false); |
604 |
} else { |
615 |
} else { |
605 |
// make attributes read-only if can't find editing options |
616 |
// make attributes read-only if can't find editing options |
Lines 976-981
Link Here
|
976 |
} else { |
987 |
} else { |
977 |
String operationId = getOperationId(taskData); |
988 |
String operationId = getOperationId(taskData); |
978 |
String newComment = getNewComment(taskData); |
989 |
String newComment = getNewComment(taskData); |
|
|
990 |
|
979 |
Set<String> changeIds = new HashSet<String>(); |
991 |
Set<String> changeIds = new HashSet<String>(); |
980 |
if (changedAttributes != null) { |
992 |
if (changedAttributes != null) { |
981 |
for (TaskAttribute ta : changedAttributes) { |
993 |
for (TaskAttribute ta : changedAttributes) { |
Lines 983-988
Link Here
|
983 |
} |
995 |
} |
984 |
} |
996 |
} |
985 |
|
997 |
|
|
|
998 |
String commentVisibility = taskData.getRoot().getMappedAttribute( |
999 |
IJiraConstants.ATTRIBUTE_PROJECT_ROLES).getValue(); |
1000 |
|
1001 |
Comment soapComment = null; |
1002 |
if (!IJiraConstants.NEW_COMMENT_VIEWABLE_BY_ALL.equals(commentVisibility)) { |
1003 |
// not related for later processing |
1004 |
changeIds.remove(IJiraConstants.ATTRIBUTE_PROJECT_ROLES); |
1005 |
|
1006 |
if (newComment != null && newComment.length() > 0) { |
1007 |
|
1008 |
soapComment = new Comment(); |
1009 |
soapComment.setComment(newComment); |
1010 |
soapComment.setRoleLevel(commentVisibility); |
1011 |
|
1012 |
newComment = null; |
1013 |
} |
1014 |
|
1015 |
} |
1016 |
|
986 |
boolean handled = false; |
1017 |
boolean handled = false; |
987 |
|
1018 |
|
988 |
// if only reassigning do not do the workflow |
1019 |
// if only reassigning do not do the workflow |
Lines 1007-1015
Link Here
|
1007 |
} |
1038 |
} |
1008 |
|
1039 |
|
1009 |
// at last try to at least post the comment (if everything else failed) |
1040 |
// at last try to at least post the comment (if everything else failed) |
1010 |
if (!handled && newComment.length() > 0) { |
1041 |
if (!handled && newComment != null && newComment.length() > 0) { |
1011 |
client.addCommentToIssue(issue, newComment, monitor); |
1042 |
client.addCommentToIssue(issue, newComment, monitor); |
1012 |
handled = true; |
1043 |
handled = true; |
|
|
1044 |
} else if (soapComment != null) { |
1045 |
client.addComentToIssueWithViewable(issue.getKey(), soapComment, monitor); |
1046 |
handled = true; |
1013 |
} |
1047 |
} |
1014 |
|
1048 |
|
1015 |
postWorkLog(repository, client, taskData, issue, monitor); |
1049 |
postWorkLog(repository, client, taskData, issue, monitor); |