• Community
  • Products
  • Jira
  • 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?

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

try this search:

customfieldname in (1st option, 2nd option)

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
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

450 views 7 5
Join discussion

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