This question is related to using ancestor vs. ancestorOrIssue in S-JQL: when would I use one over the other?
I built the following query:
issue in structure("Enterprise Portfolio", "[project in (projectA,projectB,projectC,projectD,projectE,projectF,projectG,projectH,projectI)] and ancestor in [project in (port,prog) and 'Business Area' in (Credit)]") ORDER BY key ASC
Here’s what I think this query means:
This query brought back 376 results.
I then tried this query:
issue in structure("Enterprise Portfolio", "[project in (projectA,projectB,projectC,projectD,projectE,projectF,projectG,projectH,projectI)] and ancestorOrIssue in [project in (port,prog) and 'Business Area' in (Credit)]") ORDER BY key ASC
I thought this second query would return the exact same results as the first query, because an issue can’t be in one of the Credit projects and in either the Portfolio or Program projects with the Business Area set to Credit (the Business Area field only exists in the PORT and PROG projects). But this query brought back 223 results. I tried comparing the results, but I don’t see why there’s a difference in the query results.
Can you clarify the usage of these relations, and update the Structure user guide with more examples?
Thanks!
Michelle Lekens
Michelle,
Thanks for the information and sorry for the inconvenience. It's hard to tell at this point what problem causes this, but the suspect now is the S-JQL implementation. For troubleshooting, it would be perfect if you could reproduce the problem on a test structure of a smaller size, like 10-20 issues (for example, by taking the first issues of the original structure); if it's hard, it's OK if you use the original one. Please do the following:
###################################################################### # S-JQL ###################################################################### log4j.appender.structurejql=com.atlassian.jira.logging.JiraHomeAppender log4j.appender.structurejql.File=structure-jql.log log4j.appender.structurejql.Threshold=TRACE log4j.appender.structurejql.MaxFileSize=20480KB log4j.appender.structurejql.MaxBackupIndex=1 log4j.appender.structurejql.layout=org.apache.log4j.PatternLayout log4j.appender.structurejql.layout.ConversionPattern=%d %t %m%n log4j.logger.com.almworks.jira.structure = DEBUG, filelog, console log4j.additivity.com.almworks.jira.structure = false log4j.logger.com.almworks.jira.structure.jql = TRACE, structurejql log4j.additivity.com.almworks.jira.structure.jql = false
Please note that these log settings will persist between JIRA startups. In order to switch off extensive logging for S-JQL, you'll need to revert the changes to log4j.properties file and restart JIRA again.
Again, I apologize for the inconvenience. I'm sure we'll be able to work out a solution.
Hi Igor,
We did a full re-index of JIRA, and re-ran my two queries in Issue Navigator. I got the same number of results back (the number of results for each query did not change after the re-index). I then ran your suggested JQL query, and got 0 (zero) results back. Let me know if there are any troubleshooting steps you'd like for me to take. Thanks for responding so quickly!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Michelle,
your understanding of these two relations is right. Indeed, the difference between these two queries should be that the second one matches also those issues that are both in projectA..projectI and in either of projects "prog" or "port" and have 'Business Area' set to 'Credit'. If none of projectA..projectI is "prog" or "port", there must be no difference. Moreover, even if these two queries returned different results, the second one should never return less issues than the first one.
What you observe looks like either a bug in the S-JQL implementation or a broken Lucene index (which is used for JIRA's own JQL search.) To eliminate the possibility of the latter, could you please do a full rebuild of JIRA index? (The one that requires JIRA lock, not the "background re-index" — there are cases when it's not enough.) Afterwards, could you please recheck the results of running these two queries in the Issue Navigator?
If you still observe this behaviour, please run a JQL search
project in (projectA,projectB,projectC,projectD,projectE,projectF,projectG,projectH,projectI) and project in (port,prog) and 'Business Area' in (Credit)
and report here the number of issues returned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.