Issue Details (XML | Word | Printable)

Key: JRA-4925
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Grigori Karlik
Votes: 5
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
JIRA

Custom Field: Attach File

Created: 13/Oct/04 06:47 AM   Updated: 03/Dec/04 03:38 AM
Component/s: Custom Fields, Custom Fields (new types)
Affects Version/s: 3.0 Enterprise Beta
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Reference
 

Participants: Gerd Gueldenast, Grigori Karlik, Heft, Markus, Jeff Turner [Atlassian], Mark Chaimungkalanont [Atlassian] and Scott Farquhar [Atlassian]
Since last comment: 3 years, 40 weeks ago
Labels:


 Description  « Hide
Is it possible to use the attach file field as a custom field? Or is there a plugin available? If not, I think it should be a good new feature to implement.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Gerd Gueldenast added a comment - 13/Oct/04 07:23 AM
sounds good. Then you can have "named" Attachment-Fields like:

-Technical Concept
-Test Cases

  • etc...

I think this can be useful.


Grigori Karlik added a comment - 13/Oct/04 07:43 AM
Exactly that was my intention.

Gerd Gueldenast added a comment - 13/Oct/04 09:33 AM
I like this idea.

So, dear mates at atlassian, what do you think?


Grigori Karlik added a comment - 13/Oct/04 01:16 PM
Point 1.

Jeff Turner [Atlassian] added a comment - 19/Oct/04 11:05 PM
I think this is possible to implement as a custom field. The attachment would still need to be stored/viewed in the regular attachments list, but the field could have a direct link to "it's" attachment, and the attachment could be set when editing the field.

Grigori Karlik added a comment - 21/Oct/04 02:53 AM
Hello Jeff,
so you mean that is it not possible to show the attached files "RFP", "Requirements Spec", etc. in the issue view like other custom fields in seperate fields. See JRA 4737 FileMgt_2.gif for details. Showing files at the issue tab would be nice but not necessary.

Regards,
Markus


Jeff Turner [Atlassian] added a comment - 21/Oct/04 04:15 AM
> so you mean that is it not possible to show the attached files "RFP", "Requirements Spec", etc. in the issue view like other custom fields in seperate fields.

Not currently, but it would be possible with an attachment custom field, which is the subject of this issue.

> See JRA-4737 FileMgt_2.gif for details. Showing files at the issue tab would be nice but not necessary.

You could actually format these attachment custom fields in a tab, but that would be a separate task:

http://confluence.atlassian.com/display/JIRA/A+Brief+Guide+To+JIRA+Plugins#ABriefGuideToJIRAPlugins-Issuetabpanelpluginmodules


Heft, Markus added a comment - 21/Oct/04 04:22 AM
Hi Jeff,
thanx for your fast help.
So I can implement this.

CU,
Markus Heft

----Ursprüngliche Nachricht----
Von: Jeff Turner (JIRA) jira@atlassian.com
Gesendet: Donnerstag, 21. Oktober 2004 11:17
An: Heft, Markus
Betreff: [JIRA] Commented: (JRA-4925) Custom Field: Attach File

[ http://jira.atlassian.com/browse/JRA-4925?page=comments#action_26632 ]

Jeff Turner commented on JRA-4925:
----------------------------------

Not currently, but it would be possible with an attachment custom field, which is the subject of this issue.

You could actually format these attachment custom fields in a tab, but that would be a separate task:

http://confluence.atlassian.com/display/JIRA/A+Brief+Guide+To+JIRA+Plugins#ABriefGuideToJIRAPlugins-Issuetabpanelpluginmodules


This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.atlassian.com/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira


Grigori Karlik added a comment - 01/Nov/04 03:07 PM
Hello Jeff,
could you please give me a short instruction how do I have to use the atlassian-plugin.xml file
My first atempt looks like this, but class of the customfield-type-tag has to implement the class com.atlassian.jira.issue.customfields.CustomFieldType

<atlassian-plugin key="com.atlassian.jira.plugin.customfield.attachment" name="JIRA Customfields Attachment Plugin">
<plugin-info>
<description>Customfields Attachment Plugin.</description>
<version>1.0</version>
<application-version min="3.0" max="3.0"/>
<vendor name="Atlassian Software Systems Pty Ltd" url="http://www.atlassian.com"/>
</plugin-info>

<customfield-type key="attachmentfield" name="Named Attachment Field"
class="com.atlassian.jira.issue.attachment.Attachment">
<description>A Custom Field which is used to add attachments in the edit-view and which has a specific name e.g. requirements specification.</description>
<resource type="velocity" name="view" location="templates/plugins/fields/view/view-attach.vm"/>
<resource type="velocity" name="column-view" location="templates/plugins/fields/view/view-short-attach.vm"/>
<resource type="velocity" name="edit" location="templates/edit-jiranamedattach.vm"/>
<resource type="velocity" name="xml" location="templates/plugins/fields/xml/xml-attach.vm"/>
</customfield-type>

</atlassian-plugin>


Mark Chaimungkalanont [Atlassian] added a comment - 01/Nov/04 05:56 PM
Markus,

I'm not sure exactly which bit you need help with, but I'm going to assume you need help implementing the CustomFieldType interface.

Basically there are a few Abstract classes that you can extend. The ones most pertinent for you would probably be the AbstractSingleFieldType.

If you haven't already have a look at:
http://confluence.atlassian.com/display/JIRA/Customizing+Custom+Field+Types+Tutorial

& especially the API for customfieldtype at:
http://www.atlassian.com/software/jira/docs/api/3.0/com/atlassian/jira/issue/customfields/CustomFieldType.html

You should also think about how your attachments will be stored and what your custom fields methods will do. ie. A text CF stores a string of information. Will the attachment CF store the path to the attachment? How will updating work? How will you delete etc.


Heft, Markus added a comment - 02/Nov/04 03:41 AM
Hello Mark,

the workaround should be similar to the existing file management:
1. attach files through named CF in the edit view or in a special
section in the attach file view (file manager)
2. store the data similar to Jira standard attachment fields, maybe
physically in a special folder
3. show all attachments in issue and xml view
4. use file overview (table with name, size, MIME type, attachment date
and attached by) to download or delete existing attachments

How works the Jira standard file manager?
Where can I find the java files for instance of:
com\atlassian\jira\issue\attachment\Attachment.class
com\atlassian\jira\issue\managers\DefaultAttachmentManager.class
com\atlassian\jira\issue\AttachmentManager.class

Thanks for your help.

Regards,
Markus


Mark Chaimungkalanont [Atlassian] added a comment - 02/Nov/04 04:44 PM

Markus,

Do you have the JIRA source release? If so, the source for the DefaultAttachmentManager is in atlassian-jira-enterprise-3.0.2-source\jira\src\java\com\atlassian\jira\issue\managers.

Basically the createAttachment method creates a row in the Attachment table and then saves the file to the default attachments folder.


Heft, Markus added a comment - 03/Nov/04 05:14 AM

Hello Mark,

-Mark-
Do you have the JIRA source release? If so, the source for the
DefaultAttachmentManager is in
atlassian-jira-enterprise-3.0.2-source\jira\src\java\com\atlassian\jira\
issue\managers.

-Markus-
I have the standalone version running for test and learning purposes.
What is the difference between the source and the enterprise version? We
also have a test-enterprise version running, which we will upgrade to a
licensed version probably in November.

-Mark-
Basically the createAttachment method creates a row in the Attachment
table and then saves the file to the default attachments folder.

-Markus-
Thanks for that information.

Regards
Markus


Mark Chaimungkalanont [Atlassian] added a comment - 03/Nov/04 06:34 PM
Markus,

Once you purchase a JIRA licence, you'll have access to the source distribution. This will make extending and customizing JIRA a far simpler task.

Basically Attachment class is a bean holding the information about the file (location, name, size).

DefaultAttachmentManager is an implementation of the Interface AttachmentManager. The key signature you're concerned with is:

public ChangeItemBean createAttachment(File file, String filename, String contentType, User remoteUser, GenericValue issue) throws AttachmentException, GenericEntityException


Grigori Karlik added a comment - 02/Dec/04 11:41 AM
Hello,

where can I get the java file of an ordinary custom field plugin like: "Text Field (< 255 characters) (textfield)"

I think it would be a big step to understand the standard custom field implementation.


Scott Farquhar [Atlassian] added a comment - 03/Dec/04 03:38 AM
Look at the file 'system-customfieldtypes-plugin.xml' for all the details about the existing custom fields.