Forums

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

S-JQL Relations: ancestor vs ancestorOrIssue

Michelle Parsons
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!
July 18, 2013

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:

  • - The issue is in the Enterprise Portfolio structure and
  • - The issue is in one of the Credit projects and
  • - One of the issue’s ancestors is in either the Portfolio or Program project with the Business Area set to Credit

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

3 answers

1 vote
ALM Works
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!
July 22, 2013

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:

  1. Open in text editor file log4j.properties located in the JIRA installation directory and add the following lines to the end:
    ######################################################################
    # 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
  2. Restart JIRA.
  3. Go to the Issue Navigator and run the two S-JQL queries (with ancestor andancestorOrIssue.)
  4. Open Administation | System | Atlassian Support Tools and switch to Support Zip tab. Select options Application Properties, Thread Dump, JIRA Application Logs, Tomcat Logs, Limit File Sizes. Unselect all other options. Click Create.
  5. Send the resulting file to support@almworks.com for inspection.

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.

1 vote
Michelle Parsons
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!
July 22, 2013

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!

0 votes
Igor Baltiyskiy
Contributor
July 19, 2013

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events