Hello,
I want to develop a custom field (select list) which is prefilled with some data according to the logged-in user. I successfully read and deployed the CustomField tutorial here: https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Creating+a+Custom+Field+in+JIRA
but now I am struck with extending the field to my needs. What I have so far is:
public class MoneyCustomField extends SelectCFType { public MoneyCustomField( CustomFieldValuePersister customFieldValuePersister, StringConverter stringConverter, SelectConverter selectConverter, OptionsManager optionsManager, GenericConfigManager genericConfigManager) { super(customFieldValuePersister, stringConverter, selectConverter, optionsManager, genericConfigManager); //where do I get these parameters ?!? optionsManager.createOption(arg0, arg1, arg2, arg3) }
The question is where to get the parameters for the createOptions method from?
[createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
]
If you know any example plugin which uses a SelectCFType you can also name it..I can read and program Java, I just don't know about how to access all of Jiras features.
Community moderators have prevented the ability to post new answers.
Are you able to solve the issue ? I need code sample . I need to write a custom plugin for a select list for my customization.
createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
-FieldConfig fieldConfig = field.getRelevantConfig(issue);
-parentOption ID takes value only for cascading select list
-You may set sequense long(0), tht's not really matter
-value - that's your value you want option to take
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have used this cod in one of my plugins
public Option addOptionToCustomField(CustomField customField, String value) { Option newOption = null; if (customField != null) { List<FieldConfigScheme> schemes = customField .getConfigurationSchemes(); if (schemes != null && !schemes.isEmpty()) { FieldConfigScheme sc = schemes.get(0); Map configs = sc.getConfigsByConfig(); if (configs != null && !configs.isEmpty()) { FieldConfig config = (FieldConfig) configs.keySet() .iterator().next(); OptionsManager optionsManager = getOptionsManager(); Options l = optionsManager.getOptions(config); Option opt; int numberAdded = 100; newOption = optionsManager.createOption(config, null, new Long(numberAdded), value); } } } return newOption; }
I think
int numberAdded = 100;
is used to order the options and it should probably be different for each option but it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.