We implemented a database picker field that almost works the way we need it to, however, during the drop down selection, we are seeing a '- null' in the UI from our field, only when selecting the value.
When the value is selected, the trailing '- null' goes away (that is good) in the actual issue field (view screen).
In the drop down, the value '- null' does not appear.
Only in the field itself during edit, does the '- null' appear.
I have pictures included above for a better illustration.
//Configuration Script below
I am not sure but this may be most probably because how you handle empty or null values for the INITIATIVE_NAME
field. When it is null or empty, the rendered string becomes something like INITIATIVE_ID - null
.
I'd change the renderOptionHtml function as below
renderOptionHtml = { String displayValue, GroovyRowResult row ->
def init_id = row[1]?.toString() ?: ""
def init_name = row[2]?.toString() ?: "No Name"
"$init_id - $init_name"
}
Hi @Tuncay Senturk _Snapbytes_ ,
Your answer was
closer to the solution, but the No Name appended the '- No Name' to the value, therefore I took the extra step and removed the "No Name" to it, made it "", and we're even closer now, still have a trailing '-' (see picture).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the below code
renderOptionHtml = { String displayValue, GroovyRowResult row ->
def init_id = row[1]?.toString() ?: ""
def init_name = row[2]?.toString() ?: ""
// Construct the display value based on available parts
if (init_id && init_name) {
"$init_id - $init_name"
} else {
"$init_id$init_name"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please accept the answer so that others can benefit from it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!
Start here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.