I have a select list and by default it's value is "Please select" but while displaying I want to display "Null" instead of " Please select ". I have attched the screenshots and the velocity file code. I am not sure what i am doing wrong ?
Screenshot while creating the issue
edit.vm -------- #customControlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters $auiparams) <select class="select" name="$customField.id" id="$customField.id"> #foreach ($option in $configs.options) #if(!$option.disabled || $option.disabled == false || ($value && $value == $option.optionId.toString())) #if ($value && $value.equals($option.optionId.toString())) #set ($selected = ' selected="selected"') #else #set ($selected = '') #end #if ( $selected == $option.optionId.toString() ) <option selected="selected" value=$option.optionId.toString()>$option.toString()</option> #else <option value=$option.optionId.toString()>$option.toString()</option> #end #end #end </select> #customControlFooter ($action $customField.id $fieldLayoutItem.fieldDescription $displayParameters $auiparams)
view.vm -------- #if($value == 'Please select') || $option.equals("Please select")) #set ($value = 'Null') #else $value.toString() #end
Screenshot after submitting the issue
Yes, "Please select" should not appear on a "view" screen even if you selected as an option.
I did add Please select as an option but if the user selects "Please select" I want to display null or n/a instead of "Please select".
I did also tried this condition
#if($value.
equals(
"Please select") || $option.equals("Please select"))
Um, that sounds immensely broken to me. "Please select" simply is not a sane option to have in your data - it's self-contradictory (even if you output "null", it's still wrong). Your data will actively contain "please select" implying the users have made an active choice to select "please select" as an option.
Can you explain exactly why you've done this - what are you trying to achieve? I can't think of a scenario where adding a "please select" option is a valid approach, but I'm not very imaginitive.
(I actually think I already know what you're trying to do, and there's a far better way to do it, but I don't want to chase the wrong answer if I'm guessing inaccurately)
The inbuilt select list consists of None value and we don't want that. We don't want to make that as a required field . we already have many projects in Jira and I don't want to remove none option in velocity file, which reflects entire jira instance projects. I want to develop a select list plugin without none option and also at the same point of time if the user doesn't select anything i want to display as N/a or null. I also want to increase the width of the select list in this plugin.
hmm. I am not sure if i confused you. If the user selects "please select" option then it has to display as "N/A".
Ok, that's roughly what I thought, but with a couple of extra tweaks.
First, you really do need to kill off "please select" as an option, it's pointless complexity and functionally useless.
Second, think through and decide what you actually want, because this statement is self-contradictory, you can do one or the other, but not both.
> want to develop a select list plugin without none option and also at the same point of time if the user doesn't select anything i want to display as N/a or null
Either you want to display something, or you don't. If you remove "none", then there's nothing TO display as NA/null/None/Please-select/etc. Decide whether you want:
Note that in both cases, I'm skipping the question of mandatory entry, as it's not important to the display, it's up to you to decide whether the users can skip it (although it sounds like you'll always set it)
Now, I understand you need to do this on a by-project basis, so you've got two approaches here as well.
Nope, not confused about what you are trying to do. I'm confused about your approach - you seem to be making it hideously complex, breaking your data, and bodging around it.
The fix boils down to:
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Apply agile practices
Transform how you manage your work with agile practices, including kanban and scrum frameworks.
Learning Path
Configure agile boards for Jira projects
Learn how to create and configure agile Jira boards so you can plan, prioritize, and estimate upcoming work.
Jira Essentials with Agile Mindset
Suitable for beginners, this live instructor-led full-day course will set up your whole team to understand how to use Jira with an agile methodology.