Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

convertToSingleSelect behaviour - label problem

Emil_Skrodzki
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2020

Hello,

I use behaviour and REST endpoint. Similar to https://scriptrunner.adaptavist.com/latest/jira/behaviours-conversions.html

My REST returns list in format:

items: [{value: "xyz", label: "abc", html: "123"}]

html - represents what the user see in dropdown

value - represents value to save in field

label - I think it is string presented to user when some element is chosen. But is not working.

What is the destination of the label field? How to show user something different to value?

1 answer

Suggest an answer

Log in or Sign up to answer
1 vote
Peter-Dave Sheehan
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.
February 5, 2020

The way I've used this, label and html are functionally equivalent.

html allows you to provide the label with some formatting (to highlight the matching text for example).

After the selection is complete, the label is what you see in the field.

Note that in other screens (view screen, issue navigator) the "value" is all you can display and "value" is also used in indexing and searching. I would not attempt to use some internal ID for this. 

In most cases, you will likely want "value" and "label" to be the same.

TAGS
AUG Leaders

Atlassian Community Events