Developing new custom-field type using Atlassian Connect.

Daniele Piras March 12, 2015

I saw that a similar question has already been done but the response don't convince me.

I need to develop this type of plugin for atlassian connect and extends the issue page and use the entity properties to store information IMHO isn't a correct way.

All the feature of developing customfield with P2 are missed: configure one or morecustomfields/screens/project where do you want the customfield and so on.

So If I want to create a  custom-field with atlassian connect I have to write all code to manage all this missing features.

What is the correct way? Extends issue page and write all code to manage your customfield visibility/numbers/and so on is really the correct way?

There is a demo code to develop new customfield type with Connect?

Regards,

Daniele

 

2 answers

1 accepted

2 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 12, 2015

Right, well, the short answer is "you can't".

Custom fields hook deeply into the internals of JIRA and are supported by the plugin framework around them.  When you create a custom field addon, JIRA handles a lot of the backend for you - storage, indexing, screen locations etc etc etc.  Connect is more abstracted and simply doesn't have that level of access to the internals.

So while you could replicate some of the functionality of a custom field with Connect, yes, you'd have to write all the rest of the structures for maintaining it, but also storage, and a separate way of indexing and searching it.

The last time I remember this being asked, I think @Travis Smith said something like "A custom field type" doesn't work in Connect as it does in a P2 addon.  Everything in Connect is more or less a bolted-on instead of integrated.

Travis Smith
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.
March 12, 2015

With Connect, you do need to handle all the storage, UI, and searching. You can store the data as an entity property and I'm guessing we'll see indexable entity properties one day because we now have indexable content properties in Confluence. If you store it in your add-on, you'll be 100% responsible for searching, indexing, and storage of that data.

Daniele Piras March 12, 2015

So, if you have developed a custom-field type plugins  with P2 (for standard JIRA standalone server) and your customers ask you to port the code to use your customfield with jira cloud I have to responde that isn't possible? Is it correct?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 12, 2015

Yes. P2 code is very different to Connect code - although you can reuse logical stuff like "how I calculate X for display", you'll need to write all the storage, indexing and maintenance from scratch.

2 votes
Jens Kisters //SeibertSolutions
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.
May 11, 2017

In the meantime it seems atlassian has added something for us:

https://developer.atlassian.com/static/connect/docs/latest/modules/jira/issue-field.html

Alexey Vlasov June 7, 2018

The link does not work anymore - it returns 404

James Foster September 12, 2018
Like # people like this
Kin November 30, 2020

Another URL explaining the workings of an issue field module, based on the example demo:
https://developer.atlassian.com/cloud/jira/platform/using-the-issue-field-module/

You need to add field options for this field via REST api call first:
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-custom-field-options/#api-rest-api-2-customfield-fieldid-option-post

There is also an UPDATE api call to update those field options after ie. updating data so that the fieldoptions get updated with latest source information.

Suggest an answer

Log in or Sign up to answer