Label-like field in an add-on

Arturas Rimkus April 4, 2016

I'd like to use a field type that the default Label functionality uses in JIRA. It's a type-to-search, multiple selection/tag field. However, I haven't succeeded in find it in any Atlassian documentation.

Actually, it's just like the tags field under my question.

Can someone please point me to it?

2 answers

0 votes
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2016

It sounds like you could be trying to perform one of many operations:

Depending on which one you are trying to do (and how you are trying to do it) our answers will change. For example, are you trying to get an Atlassian Connect add-on to do this?

The more information that you can provide us with the better. Cheers.

Arturas Rimkus April 5, 2016

Hi Robert. Since I'm new to JIRA add-ons, I THINK that option 3 from your list is what I'm after. What I want to do is add a labels-like field in a web section on an Issue screen, but have that field display my data (a new property for the Issue object that I will create). And yes, I want to achieve this with an Atlassian Connect add-on.

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.
April 5, 2016

Ah, ok, so I really wasn't getting that from the question.

Yes, you want option three from Robert's list.  The question I still have is "what's wrong with the existing field types"?

Arturas Rimkus April 5, 2016

Maybe a simpler question would be, what field type is the labels field? Because I want the same functionality.

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.
April 5, 2016

I know where you're coming from, but the answer is really "it's a label type field".  The code behind it is written for labels, so the indexing, UI behaviour, suggestion stuff etc - all belong to the type "JIRA labels field". 

This is why I'm asking why you can't simply add another one of the same type but a different name.

Arturas Rimkus April 5, 2016

I think we are nearing a mutual understanding smile I was confused because AUI doesn't list a "label-type field". I just noticed that a similar functionality is used for Fix Version/s on Issue screen. I guess that means I can use it for any data I need?

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.
April 5, 2016

I think so - I think you want the UI of the labels field, but for some other type of field which has other behaviour that you'd want to change or drop.  I suspect you might find "component/s" is even closer to what you're looking for - it's a fixed list of options (users can't add items) but with type and search

Arturas Rimkus April 5, 2016

I guess I'll just give it a try and see. Thanks.

Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2016

Based on your response (and the fact that you don't seem to want to re-use the existing JIRA labels field to get the job done) here is what I would recommend:

If you want an example of this actually being done you can see how I did it on the "Round transition" page of the hackathon addon. Be warned though, that example is a bit dense. It might be easier just to build it yourself from scratch. It's not that hard and please ask me (by raising new questions on Atlassian Answers and mentioning me) if you have any questions on how to make it work. Cheers.

0 votes
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.
April 4, 2016

I'm not aware of any add-on that duplicates the labels functionality.

I think that's because you can simply add a new field of type "label", with another name.  So you don't need an add-on.

Arturas Rimkus April 4, 2016

Hi Nic. I'm not trying to duplicate the labels functionality, merely to utilise the field type. The problem is, in AUI Documentation I cannot find a field of type "label". The Labels element is just that - a label - but it's not in an editable field, which is what I'm looking for.

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.
April 4, 2016

Ok, that's more information, but I'm still a little stuck.  I don't know how to explain where I'm stuck, so please bear with me while I try.

If you want to use the field type, you can just add another field of type labels.  My little brain is stuck on why this is not the right answer for you.  Labels are editable fields, you can have many of them (although I'd avoid the use of similar names) and hence I'm not sure what you're looking for.

So, you mention the aui documentation - that implies you're trying to do something with the UI, and that you're actually trying to write something, but I don't know what it might be, as there's no context.

Suggest an answer

Log in or Sign up to answer