There are no valid example for creating a custom field plugin for Jira v 7.x

Toby Jones July 19, 2017

Hi,

I have followed your tutorial

https://developer.atlassian.com/jiradev/jira-platform/guides/fields/tutorial-custom-fields-in-jira

To develop a custom field plugin.

It does not work anymore presumably because this was for an earlier version of Jira.

Errors include things such as getStringFromSIngularObject is no longer in AbstractSingleFieldType so @Override is not valid.

The end result is that I can get it to compile without errors, and the plugin is shown as enabled when doing atlas-run, but the custom field never appears when I go to select "Add Custom Field", and select "Advanced".

 

Do you have a working version of some code?

 

1 answer

0 votes
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2017

I agree that the add-on tutorials could do with a refresh. Not sure if there are any plans to do so. My O'Reilly Practical JIRA Plugins (example at https://bitbucket.org/mdoar/practical-jira-plugins) could also do with a refresh :(

 

Toby Jones July 20, 2017

Hi Matt,

Yes I have been referencing your book too. As you say, that's out of date too and doesn't work.

I wonder how you are now supposed to write a custom field plugin now that Atlassian doesn't document how to!?

MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 20, 2017

Best alternative is to look at the source for the standard custom fields that come with JIRA. It's what I did to write that book. And log a request for an updated tutorial at https://developer.atlassian.com/help#requests

Toby Jones July 24, 2017

Thats not so simple!

I went to the page to download the source (I have the cheapest license) and it does not provide a link to the source, it only suggests I contact Atlassian.

So, I have had to contact them via yet another support page.

I thought they were meant to monitor these pages but given their lack of response that doesn't seem to be the case.

Toby Jones July 25, 2017

So I now have the source.

I have the lastest version of the Plugin SDK: 6.2.14

Have taken the code from GenericTextCFType and pasted the code into my own plugin module, replacing the class name with my own (as a "test").

After fixing some imports errors, the errors that I get is with many of the functions which have been set to @Override but the functions do not exist in any superclass.

The functions that are erroing in this way are: getSingularObjectFromString, compare, getProjectImporter, getFieldTypeInfo, getJsonSchema and getJsonFromIssue, getRestFieldOperation.

Anybody any ideas?

Toby Jones July 25, 2017

Ah, so fixed that error which I'd had before but forgot: https://stackoverflow.com/questions/987973/why-does-eclipse-complain-about-override-on-interface-methods


So it does all compile now but still does not show up in the "Select a Field Type" menu on Jira even though I can see that the plugin is enabled.


I wonder if I am missing a step - all these existing fields have descriptions of each field whcih I have not entered on mine.
i.e. "Number Field - A custom field that stores and validates numeric (floating point) input.

Toby Jones July 25, 2017

Suggest an answer

Log in or Sign up to answer