• Community
  • Products
  • Jira Software
  • Questions
  • Is there any way to get the list of issue based on combination of both the first level (1st option) and second level (2nd option) of cascade select custom field?

Is there any way to get the list of issue based on combination of both the first level (1st option) and second level (2nd option) of cascade select custom field?

Firoz Khan July 23, 2015

Is there any way to get the list of issue based on combination of both the first level (1st option) and  second level (2nd option) of cascade select custom field?

Issue:

I am able to get the list of issue based on the first level (1st option) of cascade select custom field but unable to get the list of issue based on the second level (2nd option) of cascade select custom field.

it is possible through the JQL query to get the list of issue based on combination of both the first level (1st option) and  second level (2nd option) of cascade select custom field.

Requirement:

The first level (1st option) value "XYZ" and second level (2nd option) of cascade select custom field value where second level (2nd option) value is "ALL".

Example:

first level (1st option) value "XYZ"

second level (2nd option) value is "ALL".

second level (2nd option) value is "ABC".

second level (2nd option) value is "DEF".

The first level (1st option) value "XYZ" and second level (2nd option) of cascade select custom field value where second level (2nd option) value is "ALL".

To get the list of issue based on combination of both the first level (1st option) value (i.e. "XYZ") and second level (2nd option) individual group value ( (i.e. "ABC") if the second level (2nd option) selected value is "ALL".

 

1 answer

0 votes
Luca Miceli July 23, 2015

try this search:

customfieldname in (1st option, 2nd option)

Firoz Khan July 24, 2015

As per the code level Is there any way to get the list of issue based on combination of both the first level (1st option) value (i.e. "XYZ") and second level (2nd option) individual group value (i.e. "ABC")? List<Issue> issues = new ArrayList<Issue>(); SearchService searchServive = ComponentAccessor.getComponent(SearchService.class); final SearchService.ParseResult parseResult= searchServive.parseQuery(authenticationContext.getLoggedInUser(), (myJql.toString())); SearchResults searchResults = searchServive.search(authenticationContext.getLoggedInUser(),parseResult.getQuery(), PagerFilter.getUnlimitedFilter()); issues = searchResults.getIssues(); for (Issue issue : issues ) { HashMap<String, Option> hashMapEntriesCF = (HashMap<String, Option>) issue.getCustomFieldValue(customfield); if hashMapEntriesCF != null) { Option parentOpts = hashMapEntriesCF.get(null); Option childOpts = hashMapEntriesCF.get("1"); if(hashMapEntriesCF .size()>1){ log.info("Parent Group from CF "+ parentOpts.getValue().toString()); log.info("Child Group from CF "+ childOpts.getValue().toString()); log.info("Parent Group - Child Group ("+ parentOpts.getValue()+"-"+childSoln.getValue()+")"); ArrayList<Issue> existIssueArray1 = (ArrayList<Issue>)hashMapEntriesCF .get(parentOpts.getValue());// its working fine log.info("Exist Parent Group Issue Array "+existIssueArray1); ArrayList<Issue> existIssueArray2 = (ArrayList<Issue>)hashMapEntriesCF .get(childOpts.getValue());// its not working and getting null log.info("Exist Child Group Issue Array "+existIssueArray2 ); ArrayList<Issue> existIssueArray3 = (ArrayList<Issue>)hashMapEntriesCF .get(parentOpts.getValue()+"-"+childOpts.getValue());// its not working and getting null log.info("Exist Parent Group - Child Group Issue Array "+existIssueArray3); } } }

Suggest an answer

Log in or Sign up to answer