This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 169123 - Updated bug does not preserve values of custom fields in Jira
Summary: Updated bug does not preserve values of custom fields in Jira
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P2 minor with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Eugene Kuleshov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 160781 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-27 09:14 EST by Barbara Rosi-Schwartz CLA
Modified: 2007-08-22 21:35 EDT (History)
1 user (show)

See Also:


Attachments
mylar/context/zip (64.97 KB, application/octet-stream)
2007-05-24 01:02 EDT, Eugene Kuleshov CLA
no flags Details
mylyn/context/zip (80.59 KB, application/octet-stream)
2007-08-18 23:36 EDT, Eugene Kuleshov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Barbara Rosi-Schwartz CLA 2006-12-27 09:14:22 EST
When updating a Jira bug using the local task editor, the values of the customs fields,
which are invisible in the editor, get wiped out as the updated bug gets submitted to
the repository. I believe that, until the time custom fields are supported in Jira, their
values should be left alone.
Comment 1 Mik Kersten CLA 2007-01-05 16:35:14 EST
We should probably make them non-editable fields.
Comment 2 Steffen Pingel CLA 2007-02-14 00:34:17 EST
I suppose the actual problem is no values are provided for the custom fields in the HTTP post so they are set to an empty value. A possible solution would be to use the SOAP interface or to provide correct values.
Comment 3 Mik Kersten CLA 2007-02-14 20:59:33 EST
Is it possible to post the same values for custom fields/values that were originally retrieved?  This is pretty much how Bugzilla works.
Comment 4 Steffen Pingel CLA 2007-02-14 21:07:30 EST
I think the values are never retrieved.
Comment 5 Mik Kersten CLA 2007-02-14 21:11:22 EST
Ah.  Do you know if it's possible to retrieve all custom values via ..mylar.jira.core?
Comment 6 Eugene Kuleshov CLA 2007-02-14 21:54:59 EST
I guess RssContentHandler would need to be updated and we'll need to extend org.eclipse.mylar.internal.jira.core.model to support custom fields too.
Comment 7 Steffen Pingel CLA 2007-02-14 22:08:48 EST
Looks like that custom fields are indeed part of the RSS feed:

http://mylar.eclipse.org/jiratest/si/jira.issueviews:issue-xml/JIRATEST-3/JIRATEST-3.xml
Comment 8 Eugene Kuleshov CLA 2007-02-14 22:24:56 EST
They are and state machin in RssContentHandler already tracking those elements, but don't saving them into the model.
Comment 9 Steffen Pingel CLA 2007-02-18 01:58:52 EST
*** Bug 160781 has been marked as a duplicate of this bug. ***
Comment 10 Mik Kersten CLA 2007-03-22 14:44:33 EDT
Steffen: is this still happening?  If so, would is there a fix on the JIRA SOAP end of things that would resolve it?
Comment 11 Steffen Pingel CLA 2007-03-26 23:23:19 EDT
Yes, the bug is still there. The SOAP interface has support for custom fields but we currently use the web interface via POST requests to update bugs. We either need to switch the code to use SOAP or add custom field support to our RSS parser.
Comment 12 Eugene Kuleshov CLA 2007-05-23 01:15:26 EDT
Steffen, do you have any ideas how we could test this? 

I have parser and some changes for update issue action, but want to add some tests before committing them. It also seems like I can show some of these attributes in the ui too (maybe hardcoding some of the stuff for now).
Comment 13 Steffen Pingel CLA 2007-05-23 10:37:00 EDT
You could add custom fields to the test repository on mylar.eclipse.org.
Comment 14 Eugene Kuleshov CLA 2007-05-23 13:21:25 EDT
Apparently JIRA could use custom fileds for indexing/searching needs. Those fields usually aren't shown in the ui but does appear in rss xml. I wonder if we need to preserve those fields when submitting update.

Steffen, can you please drop "JIRA Toolkit" plugin to mylar.eclipse.org and restart tomcat server there? See instructions at http://confluence.atlassian.com/display/JIRAEXT/JIRA+Toolkit

I believe Codehaus JIRA is using "participants" and "days since last commit" fields.
Comment 15 Steffen Pingel CLA 2007-05-23 14:03:06 EDT
I installed http://repository.atlassian.com/jira-toolkit/jars/jira-toolkit-0.7.21.jar but the administrative interface of JIRA displays an error:

Participants of an issue (participants) 
 Displays reporter, current assignee and all commenters of the issue 
 Error: There was a problem loading the descriptor for module 'customfield-type' in plugin 'JIRA Toolkit Plugin'. Error retrieving dependency of class: com.atlassian.jira.toolkit.customfield.ParticipantsCFType. Missing class: com/atlassian/jira/issue/customfields/impl/CalculatedCFType
Comment 16 Eugene Kuleshov CLA 2007-05-23 15:40:42 EDT
Weird. I just tried it on local standalone jira install. Maybe there are some staged web app classes need to be cleaned somewhere in tomcat?
Comment 17 Steffen Pingel CLA 2007-05-23 15:54:48 EDT
Sorry, I misread the install instructions. Should work now.
Comment 18 Eugene Kuleshov CLA 2007-05-23 16:35:31 EDT
Thanks Steffen
Comment 19 Eugene Kuleshov CLA 2007-05-24 01:02:23 EDT
Steffen, I committed first cut of custom fields support and added some basic test, though it seems like JiraTaskDataHandler is involved and it is not much covered by the tests. Can you try it out please?

BTW, I wonder if JiraTaskDataHandler need to be updated to include attachment data, i.e. in buildJiraIssue() method (I moved it from JiraRepositoryConnector class since JiraTaskDataHandler is the only user of that method)
Comment 20 Eugene Kuleshov CLA 2007-05-24 01:02:25 EDT
Created attachment 68504 [details]
mylar/context/zip
Comment 21 Steffen Pingel CLA 2007-05-24 01:41:16 EDT
That's great. I'll give it a shot tomorrow.
Comment 22 Eugene Kuleshov CLA 2007-05-24 01:49:23 EDT
Note that I haven't added any support for editing or viewing those issues, just reading and persisting them. Perhaps we should use separate report for the editor support.
Comment 23 Eugene Kuleshov CLA 2007-08-18 23:28:09 EDT
I've committed some UI nits for the editing custom attributes. Right now it is only on a best effort, so there are 

-- blank but editable attributes doesn't appear in the RSS data, and as result we can't show them
-- blank and read-only attributes (not only custom ones) are filtered out, because it doesn't make sense to waste screen real estate on them
-- because of JIRA api limitations, we only support custom attributes in the task editor, but not in the new custom task editor

Anyways, doesn't seem like there is anything left here. Closing.
Comment 24 Eugene Kuleshov CLA 2007-08-18 23:36:10 EDT
Created attachment 76374 [details]
mylyn/context/zip
Comment 25 Mik Kersten CLA 2007-08-22 21:25:11 EDT
Good stuff.  Are the current limitations clear enough in the FAQ?
Comment 26 Eugene Kuleshov CLA 2007-08-22 21:35:48 EDT
(In reply to comment #25)
> Good stuff.  Are the current limitations clear enough in the FAQ?

I've updated FAQ