Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how can i get schema and options on customfield from Java API JQL by ID option ?

Vladimir Ustyan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 30, 2019

how can i get schema and options on customfield from Java API JQL by ID option ?

I have

JqlQueryBuilder builder = JqlQueryBuilder.newBuilder();

builder.where().defaultAnd().customField(customField.getIdAsLong()) - how next ?

Query query = builder.buildQuery();
logger.debug("Query: {}", query);

SearchRequest searchRequest = new SearchRequest(query);

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
May 30, 2019

Hi @Vladimir Ustyan 

Can you please be more clear? What do you want to do?

Vladimir Ustyan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 31, 2019

I want to make an analog on JQL

customField.getConfigurationSchemes().forEach(scheme -> {
AtomicReference<FieldConfig> fieldConfig = new AtomicReference<>(
((FieldConfigScheme) scheme).getOneAndOnlyConfig());

OptionsManager optionsManager = ComponentAccessor.getOptionsManager();
Options options = optionsManager.getOptions(fieldConfig.get());
for (Option option : options.getRootOptions()) {

LinkedHashMap<String, Object> o = new LinkedHashMap<String, Object>();

if (option.getOptionId().equals(controlID){

o.put("efrCFValue", option.getValue());
o.put("jiraEntityId", option.getOptionId());

arrayList.add(o);

}

}
});

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events