diff options
author | Frank Becker | 2011-10-13 18:21:41 +0000 |
---|---|---|
committer | Steffen Pingel | 2011-10-13 18:21:41 +0000 |
commit | 91d42bd75520523b081536f739513ef8bc6fce53 (patch) | |
tree | c5edf71a7fb9349a8c7b6c5a09614e47762e2a94 /org.eclipse.mylyn.bugzilla.core | |
parent | b9bf134a859194af22e2e3bdaa4413a3d4a69003 (diff) | |
download | org.eclipse.mylyn.tasks-91d42bd75520523b081536f739513ef8bc6fce53.tar.gz org.eclipse.mylyn.tasks-91d42bd75520523b081536f739513ef8bc6fce53.tar.xz org.eclipse.mylyn.tasks-91d42bd75520523b081536f739513ef8bc6fce53.zip |
ASSIGNED - bug 359300: submitting new bugs to Bugzilla 4.0 results in
error: Submit failed: invalid status: There is no status named 'NONE'
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359300
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
3 files changed, 25 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java index 938d384c4..87863f3dc 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java @@ -79,6 +79,7 @@ import org.eclipse.mylyn.commons.net.HtmlTag; import org.eclipse.mylyn.commons.net.Policy; import org.eclipse.mylyn.commons.net.WebLocation; import org.eclipse.mylyn.commons.net.WebUtil; +import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0; import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient; import org.eclipse.mylyn.tasks.core.IRepositoryQuery; import org.eclipse.mylyn.tasks.core.RepositoryResponse; @@ -1287,12 +1288,18 @@ public class BugzillaClient { String id = a.getId(); if (id.equals(BugzillaAttribute.BUG_STATUS.getKey()) && bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) >= 0) { - TaskAttribute attributeOperation = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION); - value = attributeOperation.getValue().toUpperCase(); - if (!BugzillaOperation.new_default.toString().toUpperCase().equals(value)) { - fields.put(id, new NameValuePair(id, value != null ? value : "")); //$NON-NLS-1$ - } else { - continue; + if (repositoryConfiguration.getStatusValues().contains( + BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) + || repositoryConfiguration.getStatusValues().contains( + BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) { + TaskAttribute attributeOperation = taskData.getRoot().getMappedAttribute( + TaskAttribute.OPERATION); + value = attributeOperation.getValue().toUpperCase(); + if (!BugzillaOperation.new_default.toString().toUpperCase().equals(value)) { + fields.put(id, new NameValuePair(id, value != null ? value : "")); //$NON-NLS-1$ + } else { + continue; + } } } if (id.equals(BugzillaAttribute.NEWCC.getKey())) { diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java index e9470dcce..ba65cbd23 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java @@ -28,6 +28,7 @@ import org.eclipse.mylyn.commons.net.AuthenticationCredentials; import org.eclipse.mylyn.commons.net.AuthenticationType; import org.eclipse.mylyn.commons.net.Policy; import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField.FieldType; +import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.ITaskMapping; import org.eclipse.mylyn.tasks.core.RepositoryResponse; @@ -550,8 +551,15 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler { if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) { attributeStatus.setValue(repositoryConfiguration.getStartStatus()); } else { - attributeStatus.setValue(IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.START.toString()); - repositoryConfiguration.addValidOperations(taskData); + if (repositoryConfiguration.getStatusValues().contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) + || repositoryConfiguration.getStatusValues().contains( + BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) { + + attributeStatus.setValue(IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.START.toString()); + repositoryConfiguration.addValidOperations(taskData); + } else { + attributeStatus.setValue(repositoryConfiguration.getStartStatus()); + } } createAttribute(taskData, BugzillaAttribute.SHORT_DESC); diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java index 44b227f2f..d32698458 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java @@ -1202,6 +1202,8 @@ public class RepositoryConfiguration implements Serializable { public String getStartStatus() { if (validTransitions == null) { return version.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0 + || !(getStatusValues().contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) || getStatusValues().contains( + BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) ? IBugzillaConstants.BUGZILLA_REPORT_STATUS.NEW.toString() : IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString(); } else { |