• 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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,296 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot