Forums

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

Fetch data from 2 different projects with a filter applicable to 1 project

Debashis Pyne February 7, 2018

Hi,

I am trying to extract data from 2 different projects with a filter applicable to only 1 project.

The query is as below:

project in (P1, P2) AND component = C1 ORDER BY key DESC, status ASC, summary ASC, Rank ASC

In above, P1 doesn't have the component filter however P2 does.

P2 has a lot of other records, however I wanted to extract with this component filter only.

The results do not show any records from P1.

Please advise.

2 answers

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2018

This is correct.  Your filter explicitly excludes issues from P1. 

By definition, issues in P1 cannot have component C1, so your filter won't ever get anything from it.

If you want to see issues from P1, include them in your filter.  Try

( project = P1 ) or ( project = p2 and component = C1 )

Debashis Pyne February 7, 2018

Thank you so much!.. This works :)

0 votes
Charly [DEISER]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2018

Hi

if i understand correctly your problem is in the AND clause, if P1 does not have this component you are not going to get any tickets.

Try something like this:

project = P1 OR (project = P2 AND component = C1) ORDER BY key DESC, status ASC, summary ASC, Rank ASC

this will get all of the tickets from P1 and only the tickets from P2 where the component is C1.

Hope this helps you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events