error: 'java.lang.NullPointerException - null' while creating custom field type in jira

I want to use following method for creation of custom field. But I am getting null pointer exception so I think the error is because of  FieldConfig fc=field.getRelevantConfig(issue); If this is correct then why I am getting that error and if not then can anyone help me because of which I am getting an error?


public class SelectCF extends GenericTextCFType



private final UserManager um;


private final JiraAuthenticationContext jac;


private final CustomFieldValuePersister customFieldValuePersister;


private final GenericConfigManager genericConfigManager;


private final TextFieldCharacterLengthValidator textFieldCharacterLengthValidator;


OptionsManager omm;


    public SelectCF(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager,JiraAuthenticationContext jac ,TextFieldCharacterLengthValidator textFieldCharacterLengthValidator,UserManager um ,OptionsManager omm)


    super(customFieldValuePersister, genericConfigManager,textFieldCharacterLengthValidator,jac);







public Map<String, Object> getVelocityParameters(final Issue issue,
final CustomField field,
final FieldLayoutItem fieldLayoutItem)
final Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem);

int num=0;
int num1=1;
FieldConfig fc=field.getRelevantConfig(issue);
Options options=ComponentAccessor.getComponent(Options.class);

Option op1=omm.createOption(fc, null, new Long(num), "Hello");
Option op2=omm.createOption(fc, null, new Long(num1), "World");

map.put("option1", "Hello");
map.put("option2", "World");

return map;


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,123 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you