Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 224239 - recognize status as completed if repository issue has a resolution
Summary: recognize status as completed if repository issue has a resolution
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 2.3   Edit
Hardware: PC All
: P2 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 208517 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-26 18:32 EDT by Mark Kralj-Taylor CLA
Modified: 2008-04-02 17:09 EDT (History)
2 users (show)

See Also:


Attachments
Patch for this fix. (1.07 KB, text/plain)
2008-03-26 18:39 EDT, Mark Kralj-Taylor CLA
no flags Details
mylyn/context/zip (15.91 KB, application/octet-stream)
2008-04-02 17:02 EDT, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Kralj-Taylor CLA 2008-03-26 18:32:47 EDT
The JIRA instance we use has been heavily customised.
I found that Mylyn wasn't recognising that some custom JIRA Statii indicate that a the corresponding Mylyn task is to be marked as completed.

A simple way to fix this is to mark the Mylyn task as completed if the JIRA issue has a resolution.

Add this code to the end of:  JiraRepositoryConnector.updateTaskFromTaskData(...)
  (I'll submit as a patch file in a comment)

            // PATCH: If JIRA issue has a resolution then mark it as completed
            String resolution = taskData.getAttributeValue(RepositoryTaskAttribute.RESOLUTION);
            if( resolution != null && resolution.length() > 0)
            {
                  jiraTask.setCompleted(true);
                  jiraTask.setCompletionDate(JiraUtils.stringToDate(taskData.getAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED)));
            }
            
            
There might be a better way by looking at meta data form JIRA on custom statii, but flaging completion based on having a resolution has been robust for me so far.
Comment 1 Mark Kralj-Taylor CLA 2008-03-26 18:39:07 EDT
Created attachment 93714 [details]
Patch for this fix.
Comment 2 Steffen Pingel CLA 2008-03-27 19:11:34 EDT
*** Bug 208517 has been marked as a duplicate of this bug. ***
Comment 3 Steffen Pingel CLA 2008-04-02 17:01:58 EDT
Thanks Mark. That's is a great suggestion! The code that determines whether a task is complete now checks for a resolution. This might still fail for some repository configurations but it is more robust than using hard-coded status ids.
Comment 4 Steffen Pingel CLA 2008-04-02 17:02:02 EDT
Created attachment 94628 [details]
mylyn/context/zip
Comment 5 Eugene Kuleshov CLA 2008-04-02 17:09:16 EDT
BTW, I've seen some JIRA workflows that didn't change resolution to "unresolved" (-1) when reopening tasks. Though that might be considered a bug in custom workflow configuration and proposed enhancement would work great otherwise.