Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 194570

Summary: [api] JiraTaskDataHandler.postTaskData() should return id instead of key
Product: z_Archived Reporter: Richard Evans <richard.evans>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: ekuleshov, steffen.pingel
Version: unspecified   
Target Milestone: 3.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Richard Evans CLA 2007-06-27 04:29:59 EDT
Creating a bug in Jira gives the error below.  The bug is created successfully however.

-- Error Log --
Date: Wed Jun 27 09:27:08 BST 2007
Message: invalid handle for task, can not contain: -, was: DIR-3922
Severity: Error
Plugin ID: org.eclipse.mylyn
Stack Trace:
java.lang.RuntimeException: invalid handle for task, can not contain: -, was: DIR-3922
at org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil.getHandle(RepositoryTaskHandleUtil.java:27)
at org.eclipse.mylyn.tasks.core.TaskList.getTask(TaskList.java:470)
at org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector.createTaskFromExistingId(AbstractRepositoryConnector.java:96)
at org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector.createTaskFromExistingId(AbstractRepositoryConnector.java:88)
at org.eclipse.mylyn.tasks.ui.editors.AbstractRepositoryTaskEditor.updateSubmittedTask(AbstractRepositoryTaskEditor.java:2923)
at org.eclipse.mylyn.tasks.ui.editors.AbstractNewRepositoryTaskEditor.updateSubmittedTask(AbstractNewRepositoryTaskEditor.java:463)
at org.eclipse.mylyn.tasks.ui.editors.AbstractRepositoryTaskEditor$37.run(AbstractRepositoryTaskEditor.java:2709)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Mik Kersten CLA 2007-06-27 10:35:20 EDT
Steffen, Eugene: if JIRA needs this policy to be temporarily disabled for 2.0 I can consider it, although a fix at the source would be better.  We fully freeze the Europa/EPP content early aft so let me know.
Comment 2 Eugene Kuleshov CLA 2007-06-27 10:41:06 EDT
Richard, what version you are using? It seems like your stack trace don't match the code in CVS and I can't reproduce this with the latest dev build. Can you please try to the last build? See download details at http://www.eclipse.org/mylyn/dl.php
Comment 3 Richard Evans CLA 2007-06-27 10:46:57 EDT
I did an update from the mylyn extras site yesterday (http://download.eclipse.org/tools/mylyn/update/extras).  I'll try another update
Comment 4 Eugene Kuleshov CLA 2007-06-27 10:52:37 EDT
Are you running on Eclipse 3.3? Can you please check from Help / About / Plugins which jira plugin version you have? Thanks
Comment 5 Richard Evans CLA 2007-06-27 11:03:16 EDT
The plugin list shows:

2.0.0.v20070623-1130 and 2.0.0.v20070615-compatability

for the jira core plugin
Comment 6 Eugene Kuleshov CLA 2007-06-27 11:25:10 EDT
I am using 20070626 build.
Comment 7 Richard Evans CLA 2007-06-27 11:26:20 EDT
Just updated and now the problem does not occur.  Apologies for wasting your time on this!
Comment 8 Eugene Kuleshov CLA 2007-06-27 11:27:47 EDT
No problem. Glad that it is working for you now.
Comment 9 Steffen Pingel CLA 2007-06-27 12:09:47 EDT
Eugene, the root cause of this bug is that JiraTaskDataHandler.postTaskData() returns the key and not the id (which is the API contract). This is not necessary anymore and should be changed.
Comment 10 Eugene Kuleshov CLA 2007-06-27 12:14:58 EDT
Good point. Though it seems like fix would require an extra roundtrip to the server... 
Comment 11 Steffen Pingel CLA 2007-06-29 16:29:32 EDT
*** Bug 194964 has been marked as a duplicate of this bug. ***
Comment 12 Steffen Pingel CLA 2008-04-26 00:04:28 EDT
Changed postTaskData() in JiraTaskDataHandler2 to return a response object that has the task id instead of the key. We can consider to maintain a key/id mapping in the connector core in case the additional server round trip turns out to be too expensive. I'll review this change as part of the 3.0 performance cycle for the JIRA connector.
Comment 13 Steffen Pingel CLA 2008-04-26 00:05:32 EDT
Created attachment 97711 [details]
mylyn/context/zip