Bug 288347 - only update comment or reassign if this is the only change for the task
Summary: only update comment or reassign if this is the only change for the task
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 3.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P2 enhancement (vote)
Target Milestone: 3.3   Edit
Assignee: Pawel Niewiadomski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 213528 214971 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-02 08:19 EDT by Pawel Niewiadomski CLA
Modified: 2009-09-24 05:37 EDT (History)
2 users (show)

See Also:


Attachments
Simple fix for this (1.35 KB, patch)
2009-09-02 08:23 EDT, Pawel Niewiadomski CLA
no flags Details | Diff
Added null check (5.89 KB, patch)
2009-09-03 05:59 EDT, Pawel Niewiadomski CLA
no flags Details | Diff
mylyn/context/zip (3.77 KB, application/octet-stream)
2009-09-03 05:59 EDT, Pawel Niewiadomski CLA
no flags Details
More sophisticated handling of changes (3.01 KB, patch)
2009-09-03 08:45 EDT, Pawel Niewiadomski CLA
no flags Details | Diff
mylyn/context/zip (129.84 KB, application/octet-stream)
2009-09-03 08:47 EDT, Pawel Niewiadomski CLA
no flags Details
Additional tests (5.39 KB, patch)
2009-09-21 08:22 EDT, Pawel Niewiadomski CLA
no flags Details | Diff
All changes in one patch against the HEAD (10.71 KB, patch)
2009-09-23 08:31 EDT, Pawel Niewiadomski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Niewiadomski CLA 2009-09-02 08:19:58 EDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; pl; rv:1.9.0.13) Gecko/2009073021 Firefox/3.0.13 GTB5
Build Identifier: 

Currently if you edit a JIRA task and only edit a comment the whole JIRA issue gets updated - that causes some custom fields to be reset (check https://bugs.eclipse.org/bugs/show_bug.cgi?id=255854). 

JIRA has a nice API for adding only a comment and I think it would be right to use it in this scenario - it will probably improve performance, will be a good temporary workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=255854.

Reproducible: Always
Comment 1 Pawel Niewiadomski CLA 2009-09-02 08:23:44 EDT
Created attachment 146273 [details]
Simple fix for this
Comment 2 Steffen Pingel CLA 2009-09-02 18:36:38 EDT
Looks good. Can you add a null check for changedAttributes? It's legal to pass null for it if the list of changed attributes is not known. Can you also add a test case to JiraTaskDataHandlerTest that uses the guest account which has limited privileges and should not be allowed to edit issues?

As a side it would be great if you could attach contexts with patches.
Comment 3 Steffen Pingel CLA 2009-09-02 18:37:37 EDT
*** Bug 213528 has been marked as a duplicate of this bug. ***
Comment 4 Pawel Niewiadomski CLA 2009-09-03 05:59:00 EDT
Created attachment 146369 [details]
Added null check

Not going to write tests until I have access to your JIRA test server - please provide me with proper credentials.
Comment 5 Pawel Niewiadomski CLA 2009-09-03 05:59:06 EDT
Created attachment 146370 [details]
mylyn/context/zip
Comment 6 Pawel Niewiadomski CLA 2009-09-03 08:45:46 EDT
Created attachment 146381 [details]
More sophisticated handling of changes

Please ignore my previous patch - changes for other issue also were attached.

Here's another patch with more sophisticated changes handling - in addition if only asignee was changed use JIRA assignIssueTo action.
Comment 7 Pawel Niewiadomski CLA 2009-09-03 08:47:09 EDT
Created attachment 146382 [details]
mylyn/context/zip
Comment 8 Steffen Pingel CLA 2009-09-03 16:15:08 EDT
Sounds great. I'll look at it once it includes a test case. Here are the instructions for running the test suite: http://wiki.eclipse.org/Mylyn_Contributor_Reference#JUnit_tests
Comment 9 Pawel Niewiadomski CLA 2009-09-08 06:27:28 EDT
Steffen I need your help here as I don't have admin permission for JIRA test server. I need a project with a custom permission scheme - user should be able to create issues, assign them but not edit them. This will ensure that re-assigning doesn't need edit permission. Can you configure this for me?
Comment 10 Thomas Ehrnhoefer CLA 2009-09-08 11:20:51 EDT
No problem Pawel. I will look into this.
Comment 11 Thomas Ehrnhoefer CLA 2009-09-14 18:34:30 EDT
Pawel, I created the following:

* New group "read-only"
* new user (part of that and only that group) called "read-only@mylyn.eclipse.org" (same password as tests@m.e.o)
* added this new group in the permission scheme to "Create Issues" and "Assign Issues"

Is that what you were looking for?
Comment 12 Steffen Pingel CLA 2009-09-17 19:45:23 EDT
*** Bug 214971 has been marked as a duplicate of this bug. ***
Comment 13 Pawel Niewiadomski CLA 2009-09-21 08:22:31 EDT
Created attachment 147685 [details]
Additional tests
Comment 14 Steffen Pingel CLA 2009-09-21 13:49:55 EDT
I get a compile error when I apply the patch. Can you make a single patch with all changes including o.e.m.context.tests and the jira test cases?
Comment 15 Pawel Niewiadomski CLA 2009-09-23 08:31:45 EDT
Created attachment 147886 [details]
All changes in one patch against the HEAD

Thanks Steffen. Here's the patch with everything inside. Hope it will compile smoothly.

Cheers,
Pawel
Comment 16 Steffen Pingel CLA 2009-09-23 15:45:58 EDT
Thanks. Great patch! I have applied it with minor modifications to remove some code duplication.
Comment 17 Pawel Niewiadomski CLA 2009-09-24 05:37:43 EDT
Thank you Steffen.