Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-06-17 13:05:59 -0400
committerGerrit Code Review @ Eclipse.org2016-06-21 11:13:15 -0400
commit35128e075305ab755a192122a793e69881c3e77d (patch)
tree9ad7d4c93e4fce494aabc42d4fbd88b2ff3c7d6e /connector-bugzilla-rest
parenta2896831fb1b1f804e2d412c78b697230860137e (diff)
downloadorg.eclipse.mylyn.tasks-35128e075305ab755a192122a793e69881c3e77d.tar.gz
org.eclipse.mylyn.tasks-35128e075305ab755a192122a793e69881c3e77d.tar.xz
org.eclipse.mylyn.tasks-35128e075305ab755a192122a793e69881c3e77d.zip
495613: Bugzilla "Add self to CC" doesn't work when creating new bugs
(for the REST Connector) Change-Id: Ia0b76a6aaacfa8b0ba3f73e7a60cf5fbe6b22e1a Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=495613
Diffstat (limited to 'connector-bugzilla-rest')
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java3
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java21
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskDataHandler.java5
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java36
14 files changed, 64 insertions, 15 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch
index 333c74c4c..efba6e123 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch
@@ -29,7 +29,7 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -consolelog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.mylyn.bugzilla.rest.core.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx256m -XX:MaxPermSize=128m&#10;-Dorg.eclipse.mylyn.tests.all=false"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx256m&#10;-Dorg.eclipse.mylyn.tests.all=true"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch
index 009b8cd95..87afb9f3d 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch
@@ -29,7 +29,7 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -consolelog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.mylyn.bugzilla.rest.core.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx256m -XX:MaxPermSize=128m&#10;-Dorg.eclipse.mylyn.tests.all=false&#10;-Dorg.eclipse.mylyn.tests.ignore.local.services=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx256m&#10;-Dorg.eclipse.mylyn.tests.all=true&#10;-Dorg.eclipse.mylyn.tests.ignore.local.services=true"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java
index 8d3dbc95e..c9941fda8 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java
@@ -189,7 +189,7 @@ public class BugzillaRestClientTest {
assertEquals(
IOUtils.toString(
CommonTestUtil.getResource(this, actualFixture.getTestDataFolder() + "/parameters.json")),
- new Gson().toJson(parameter));
+ new Gson().toJson(parameter).replaceAll(repository.getRepositoryUrl(), "http://dummy.url"));
assertEquals(
IOUtils.toString(
CommonTestUtil.getResource(this, actualFixture.getTestDataFolder() + "/configuration.json")),
@@ -489,6 +489,7 @@ public class BugzillaRestClientTest {
taskDataGet.getRoot().removeAttribute("removeCC");
taskDataGet.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().RESET_QA_CONTACT.getKey());
taskDataGet.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().RESET_ASSIGNED_TO.getKey());
+ taskDataGet.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().ADD_SELF_CC.getKey());
// attributes for operations
taskDataGet.getRoot().removeAttribute("task.common.operation-CONFIRMED");
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt
index 99bc99ff2..889e2e664 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt
@@ -12,7 +12,6 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=alias,values=[],options=null,metaData={task.meta.label=Alias, task.meta.type=shortText, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=task.common.user.assigned,values=[],options=null,metaData={task.meta.label=Assigned to, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=task.common.user.cc,values=[],options=null,metaData={task.meta.label=CC, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
- TaskAttribute[id=task.common.addselfcc,values=[],options=null,metaData={task.meta.label=Add Self to CC, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
TaskAttribute[id=description_is_private,values=[],options=null,metaData={task.meta.label=Description is private, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=qa_contact,values=[],options=null,metaData={task.meta.label=QA Contact, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=target_milestone,values=[],options={---=---, M1=M1, M1.0=M1.0, M2=M2, M2.0=M2.0, M3=M3, M3.0=M3.0},metaData={task.meta.label=Target milestone, task.meta.type=singleSelect, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=true, task.meta.dependson.attribute=task.common.product}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt
index be848efaa..a396ee7b0 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt
@@ -12,7 +12,6 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=alias,values=[],options=null,metaData={task.meta.label=Alias, task.meta.type=shortText, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=task.common.user.assigned,values=[],options=null,metaData={task.meta.label=Assigned to, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=task.common.user.cc,values=[],options=null,metaData={task.meta.label=CC, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
- TaskAttribute[id=task.common.addselfcc,values=[],options=null,metaData={task.meta.label=Add Self to CC, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
TaskAttribute[id=description_is_private,values=[],options=null,metaData={task.meta.label=Description is private, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=qa_contact,values=[],options=null,metaData={task.meta.label=QA Contact, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=target_milestone,values=[],options={---=---, M1=M1, M1.0=M1.0, M2=M2, M2.0=M2.0, M3=M3, M3.0=M3.0},metaData={task.meta.label=Target milestone, task.meta.type=singleSelect, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=true, task.meta.dependson.attribute=task.common.product}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt
index 68fe8fe09..e3ab9eca8 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt
@@ -12,7 +12,6 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=alias,values=[],options=null,metaData={task.meta.label=Alias, task.meta.type=shortText, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=task.common.user.assigned,values=[],options=null,metaData={task.meta.label=Assigned to, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=task.common.user.cc,values=[],options=null,metaData={task.meta.label=CC, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
- TaskAttribute[id=task.common.addselfcc,values=[],options=null,metaData={task.meta.label=Add Self to CC, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
TaskAttribute[id=description_is_private,values=[],options=null,metaData={task.meta.label=Description is private, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=qa_contact,values=[],options=null,metaData={task.meta.label=QA Contact, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=target_milestone,values=[---],options={---=---},metaData={task.meta.label=Target milestone, task.meta.type=singleSelect, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=true, task.meta.dependson.attribute=task.common.product}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt
index 99bc99ff2..889e2e664 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt
@@ -12,7 +12,6 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=alias,values=[],options=null,metaData={task.meta.label=Alias, task.meta.type=shortText, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=task.common.user.assigned,values=[],options=null,metaData={task.meta.label=Assigned to, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=task.common.user.cc,values=[],options=null,metaData={task.meta.label=CC, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
- TaskAttribute[id=task.common.addselfcc,values=[],options=null,metaData={task.meta.label=Add Self to CC, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
TaskAttribute[id=description_is_private,values=[],options=null,metaData={task.meta.label=Description is private, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=qa_contact,values=[],options=null,metaData={task.meta.label=QA Contact, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=target_milestone,values=[],options={---=---, M1=M1, M1.0=M1.0, M2=M2, M2.0=M2.0, M3=M3, M3.0=M3.0},metaData={task.meta.label=Target milestone, task.meta.type=singleSelect, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=true, task.meta.dependson.attribute=task.common.product}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt
index be848efaa..a396ee7b0 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt
@@ -12,7 +12,6 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=alias,values=[],options=null,metaData={task.meta.label=Alias, task.meta.type=shortText, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=task.common.user.assigned,values=[],options=null,metaData={task.meta.label=Assigned to, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=task.common.user.cc,values=[],options=null,metaData={task.meta.label=CC, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
- TaskAttribute[id=task.common.addselfcc,values=[],options=null,metaData={task.meta.label=Add Self to CC, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
TaskAttribute[id=description_is_private,values=[],options=null,metaData={task.meta.label=Description is private, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=qa_contact,values=[],options=null,metaData={task.meta.label=QA Contact, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=target_milestone,values=[],options={---=---, M1=M1, M1.0=M1.0, M2=M2, M2.0=M2.0, M3=M3, M3.0=M3.0},metaData={task.meta.label=Target milestone, task.meta.type=singleSelect, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=true, task.meta.dependson.attribute=task.common.product}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt
index 68fe8fe09..e3ab9eca8 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt
@@ -12,7 +12,6 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=alias,values=[],options=null,metaData={task.meta.label=Alias, task.meta.type=shortText, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=task.common.user.assigned,values=[],options=null,metaData={task.meta.label=Assigned to, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=task.common.user.cc,values=[],options=null,metaData={task.meta.label=CC, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
- TaskAttribute[id=task.common.addselfcc,values=[],options=null,metaData={task.meta.label=Add Self to CC, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false}]
TaskAttribute[id=description_is_private,values=[],options=null,metaData={task.meta.label=Description is private, task.meta.type=boolean, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=qa_contact,values=[],options=null,metaData={task.meta.label=QA Contact, task.meta.type=person, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.required=false, task.meta.dependson.attribute=task.common.component}]
TaskAttribute[id=target_milestone,values=[---],options={---=---},metaData={task.meta.label=Target milestone, task.meta.type=singleSelect, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=true, task.meta.dependson.attribute=task.common.product}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java
index ed8730dc0..bb5740c65 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java
@@ -80,8 +80,6 @@ public class BugzillaRestCreateTaskSchema extends AbstractTaskSchema {
public final Field CC = createField(TaskAttribute.USER_CC, "CC", TaskAttribute.TYPE_PERSON, Flag.PEOPLE);
- public final Field ADD_SELF_CC = inheritFrom(parent.ADD_SELF_CC).addFlags(Flag.PEOPLE).create();
-
public final Field DESCRIPTION_IS_PRIVATE = createField("description_is_private", "Description is private",
TaskAttribute.TYPE_BOOLEAN, Flag.ATTRIBUTE);
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
index 4dbd1af02..8fce3c2df 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
@@ -142,13 +142,13 @@ public class BugzillaRestPutUpdateTask extends BugzillaRestAuthenticatedPutReque
if (element.getValues().size() > 1) {
setOld = new HashSet<String>(element.getValues());
} else {
- setOld = new HashSet<String>(Arrays.asList(element.getValue().split("\\s*,\\s*")));
+ setOld = new HashSet<String>(Arrays.asList(element.getValue().split("\\s*,\\s*"))); //$NON-NLS-1$
}
Set<String> setNew;
if (taskAttribute.getValues().size() > 1) {
setNew = new HashSet<String>(taskAttribute.getValues());
} else {
- setNew = new HashSet<String>(Arrays.asList(taskAttribute.getValue().split("\\s*,\\s*")));
+ setNew = new HashSet<String>(Arrays.asList(taskAttribute.getValue().split("\\s*,\\s*"))); //$NON-NLS-1$
}
BugzillaRestGsonUtil.getDefault().buildAddRemoveIntegerHash(out, id, setOld, setNew);
} else if (id.equals(BugzillaRestTaskSchema.getDefault().KEYWORDS.getKey())) {
@@ -168,9 +168,26 @@ public class BugzillaRestPutUpdateTask extends BugzillaRestAuthenticatedPutReque
}
}
}
+ TaskAttribute cc = taskData.getRoot().getAttribute(BugzillaRestTaskSchema.getDefault().CC.getKey());
TaskAttribute addCC = taskData.getRoot().getAttribute(BugzillaRestTaskSchema.getDefault().ADD_CC.getKey());
TaskAttribute removeCC = taskData.getRoot()
.getAttribute(BugzillaRestTaskSchema.getDefault().REMOVE_CC.getKey());
+ TaskAttribute addSelfCC = taskData.getRoot()
+ .getAttribute(BugzillaRestTaskSchema.getDefault().ADD_SELF_CC.getKey());
+ if (Boolean.valueOf(addSelfCC.getValue())) {
+ String userName = addSelfCC.getMetaData().getValue("UserName"); //$NON-NLS-1$
+ if (userName != null) {
+ if (removeCC.getValues().contains(userName)) {
+ removeCC.removeValue(userName);
+ } else if (!cc.getValues().contains(userName)) {
+ List<String> addCCList = Arrays.asList(addCC.getValue().split("\\s*,\\s*")); //$NON-NLS-1$
+ if (!addCCList.contains(userName)) {
+ addCC.setValue(userName + (addCCList.size() > 0 && !addCCList.get(0).equals("") ? ", " : "") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + addCC.getValue());
+ }
+ }
+ }
+ }
if (addCC.getValues().size() > 0 || removeCC.getValues().size() > 0) {
Set<String> setOld = new HashSet<String>(removeCC.getValues());
HashSet<String> setNew = new HashSet<String>(Arrays.asList(addCC.getValue().split("\\s*,\\s*"))); //$NON-NLS-1$
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskDataHandler.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskDataHandler.java
index f25f0e81f..cc4b97daf 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskDataHandler.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskDataHandler.java
@@ -77,6 +77,11 @@ public class BugzillaRestTaskDataHandler extends AbstractTaskDataHandler {
if (config != null) {
config.updateInitialTaskData(data);
}
+ TaskAttribute addSelfCC = data.getRoot().getAttribute(BugzillaRestTaskSchema.getDefault().ADD_SELF_CC.getKey());
+ if (addSelfCC != null) {
+ addSelfCC.getMetaData().putValue("UserName", repository.getUserName()); //$NON-NLS-1$
+ }
+
return true;
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
index 470a347d7..5f4c16fa6 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
@@ -118,7 +118,7 @@ public class BugzillaRestTaskSchema extends AbstractTaskSchema {
public final Field REMOVE_CC = createField("removeCC", "CC selected for remove",
IBugzillaRestConstants.EDITOR_TYPE_CC);
- public final Field ADD_SELF_CC = inheritFrom(parent.ADD_SELF_CC).addFlags(Flag.PEOPLE).create();
+ public final Field ADD_SELF_CC = inheritFrom(parent.ADD_SELF_CC).create();
public final Field COMMENT_ISPRIVATE = inheritFrom(parent.COMMENT_ISPRIVATE).addFlags(Flag.ATTRIBUTE).create();
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java
index 08b628225..3c1ee6e49 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java
@@ -18,6 +18,7 @@ import java.util.Map;
import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestTaskSchema;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorPeoplePart;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
@@ -31,7 +32,7 @@ public class BugzillaRestTaskEditorPeoplePart extends TaskEditorPeoplePart {
attributes.add(getTaskData().getRoot()
.getMappedAttribute(BugzillaRestTaskSchema.getDefault().RESET_ASSIGNED_TO.getKey()));
attributes.add(getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_REPORTER));
- attributes.add(getTaskData().getRoot().getMappedAttribute(TaskAttribute.ADD_SELF_CC));
+ addSelfToCC(attributes);
attributes.add(getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_CC));
for (TaskAttribute attribute : allAttributes.values()) {
TaskAttributeMetaData properties = attribute.getMetaData();
@@ -43,5 +44,38 @@ public class BugzillaRestTaskEditorPeoplePart extends TaskEditorPeoplePart {
}
return attributes;
}
+ private void addSelfToCC(List<TaskAttribute> attributes) {
+ if (getTaskData().isNew()) {
+ return;
+ }
+ TaskRepository repository = this.getTaskEditorPage().getTaskRepository();
+
+ if (repository.getUserName() == null) {
+ return;
+ }
+
+ TaskAttribute root = getTaskData().getRoot();
+ TaskAttribute owner = root.getMappedAttribute(TaskAttribute.USER_ASSIGNED);
+ if (owner != null && owner.getValue().indexOf(repository.getUserName()) != -1) {
+ return;
+ }
+
+ TaskAttribute reporter = root.getMappedAttribute(TaskAttribute.USER_REPORTER);
+ if (reporter != null && reporter.getValue().indexOf(repository.getUserName()) != -1) {
+ return;
+ }
+
+ TaskAttribute ccAttribute = root.getMappedAttribute(TaskAttribute.USER_CC);
+ if (ccAttribute != null && ccAttribute.getValues().contains(repository.getUserName())) {
+ return;
+ }
+
+ TaskAttribute attrAddToCC = getTaskData().getRoot().getMappedAttribute(TaskAttribute.ADD_SELF_CC);
+ if (attrAddToCC == null) {
+ attrAddToCC = getTaskData().getRoot().createMappedAttribute(TaskAttribute.ADD_SELF_CC);
+ }
+ attributes.add(attrAddToCC);
+
+ }
}

Back to the top