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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,163
Community Members
 
Community Events
185
Community Groups

Remove option "None" without requiring the field

Edited

Hi, I need to remove the option None everytime I create select lists or radio buttons. I know it can be done through making it required but it affects the whole creation of issues. It is because during creation of issues, my select lists are not yet in the create issue screen therefore I can't proceed to make such.

I found out that it could be achieved without making the field to required if I'll edit the file "edit-select.vm" (C:\Program Files\Atlassian\JIRA\atlassian-jira\WEB-INF\classes\templates\plugins\fields\edit) by this link: 

https://confluence.atlassian.com/jirakb/how-to-remove-none-from-a-select-list-custom-field-144212308.html

however, this solution isn't updated for the current JIRA. By the way I am running the latest version of server (7.9.2) 

Thank you for your time

5 comments

Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 04, 2018 • edited

Hi @Franco C. A.

You can use the following javascript to remove the "None" option.

  • Go to Field Config
  • Edit the CF
  • Paste the code
<script type="text/javascript">
AJS.$(function() {
var cfList = document.getElementById('customfield_xxxxx')
cfList.remove(0)
});
</script>

ps: It is also possible to do it via Script Runner (Behaviours) add-on.

Tansu Akdeniz

Like Deepali Bagul likes this

Hi @Tansu AkdenizAkdeniz,

Can you please guide how we can do it using script runner.

Thanks,
Raj

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.
Jun 04, 2018

Why bother?

If you remove "none", you're telling the user that they cannot leave the field empty.  Which is the same as making it mandatory.

Azfar Masut
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.
Jul 04, 2019 • edited

if it's a shared field configuration scheme, you'll need to create another field configuration scheme just for that project. If you have hundreds of projects, you don't want to be creating a field configuration scheme for each of them, with every project has different requirement towards different fields. 

Unless you have a workaround?

It's very confusing. Agree with @Azfar Masut. I just need one mandatory field in only one screen. I make it required, affect all process. Even for project creation it becomes required field. I don't want to create another field configuration scheme. I didn't added this field to create screen. 

Azfar Masut
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.
Jul 04, 2019

Using scriptrunner behavior, you can use something like below. 

Set the field as required/not required (on behavior side, not JIRA's field configuration), depending on your use case.

In my case, I want my severity field to be set as required only on a certain project, without having to create additional field configuration (as I have one massively shared field configuration - for process standard in my company).

So I set the severity field as required through behavior, but the 'none' option stills show. So, use below script :

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.manager.OptionsManager
def optionsManager = ComponentAccessor.getComponent(OptionsManager)

def severity = getFieldByName("Severity")
severity.setAllowInlineEdit(false)

def sevcustomField = customFieldManager.getCustomFieldObject(severity.getFieldId())
def sevconfig = sevcustomField.getRelevantConfig(getIssueContext())
def sevOptionsOriginal = optionsManager.getOptions(sevconfig)

/*define the select list manually, do not include the 'none'*/
def sevOptionsCustYes = sevOptionsOriginal.findAll { it.value in ['Critical', 'Serious','Medium','Low'] }

severity.setFieldOptions( sevOptionsCustYes )
Like # people like this

where did you write this script .?

Like Nivida Sharma likes this
Azfar Masut
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.
Oct 15, 2019

@Todd Lindsey Behavior Script Section in Scriptrunner

That doesnt work.

I did the changes for my problem but I see the "None" Option in every Screen:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.manager.OptionsManager
def optionsManager = ComponentAccessor.getComponent(OptionsManager)

def dauer = getFieldByName("dauer")
dauer.setAllowInlineEdit(false)

def dauerCustomField = customFieldManager.getCustomFieldObject(dauer.getFieldId())
def dauerConfig = dauerCustomField.getRelevantConfig(getIssueContext())
def dauerOptionsOriginal = optionsManager.getOptions(dauerConfig)

/*define the select list manually, do not include the 'none'*/
def dauerOptionsCustYes = dauerOptionsOriginal.findAll { it.value in ['Critical', 'Serious','Medium','Low'] }

dauer.setFieldOptions( dauerOptionsCustYes )

hello from the future!

Just want to say this script has saved me so much headache! This works on Behaviors and I thank you very very much!

Like Azfar Masut likes this

I tried pasting this in the configuration of the field the option remained after i re-index, can't get it to remove and don't have scriptrunner

Is there any alternative for removing the None option, other than using script ?

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.
Nov 28, 2019

Make the field mandatory?  As you don't want "none" to be selectable, your people will have to put something into it

Comment

Log in or Sign up to comment