Forums

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

How to extract a list of issues that are linked to another project type and have a particular label

Nidhi Prasad May 13, 2020

project = support and IssueFunction in linkedIssuesOfAll("project=product")

I would now like to extract a list of issues from Project=Product which have a particular label on them. 
 
How can I construct a JQL to get such a result?

2 answers

0 votes
Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

Hi Nidhi,

Sadly you cannot achieve the desired search using standard features on Jira, you must go for a third-party app instead. Using i.e. JQL Booster Pack you can type the following:

 

1) Extract a list of issues that are linked to another project type and have a particular label

project = support and issue IN linkedIssuesOf(' project=product AND labels=mylabel')

(*) Note that this is just an example, you must tune above query to fit your needs, such as using issueFunction field instead of issue if you are using Script Runner.

 

Using this app you can also query other issues relations, check:

 

References:

Nidhi Prasad May 14, 2020

So currently there is no way to have a JQL that would list out issues with a particular label on them when the issues are linked to two projects? 

Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

Not natively, since you need the linkedIssuesOf() function provided by 3rd-party apps, but I believe you already have that function on your instance, haven't you?

 

Could you try the suggested JQL above?

Nidhi Prasad May 14, 2020

project = support and issue IN linkedIssuesOf(' project=product AND labels=mylabel'), does not work when I put in the label of my choice. 

Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

Have you identify any task of project Support that are linked to a task on product project having the given label?

Iif so, could you please share with us some screenshots where we can see those issues and their relationship to figure out where the problem is.

 

Thanks in advance

Nidhi Prasad May 14, 2020

An issue from Project Support is linked to an issue from Project Product. 

Based on the issues that are linked, I need a list of issues only from Project Product which have a particular label on them

screenshot.png

Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

In that case, the provided JQL should work.

 

project = support and issue IN linkedIssuesOf(' project=product AND labels=mylabel')

 

Above JQL will retrieve issues on support project linked to any issue of product project having given label on it.

 

Since you also added extra clausures on your JQL, could you simply run the above one as it? to see if they retrieve any results and then try to further refine the query.

Nidhi Prasad May 14, 2020

Capture.PNG

Nidhi Prasad May 14, 2020

The JQL still does not give me any results

Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

And again... are you sure there is an issue on support project linked to a issue on product project having that label?

 

Could you share with us those two issues? Since JQL relies on lucene cache, you can also tries to re-index both project to see if the cache is outdated.

 

You can reindex a single project by:

  1. Visit the project
  2. Click on the administrator tab
  3. Click on the gray Actions button >> Reindex project

 

Regards

Nidhi Prasad May 14, 2020

Capture.PNG

 

 

As you can see from the screenshot here, a support ticket is linked to a PROD ticket. And on the PROD ticket, there are various labels on them. I need an extract of those tickets which correspond to that particular label and which do not. 

Nidhi Prasad May 14, 2020

Also, I do not have admin privileges and hence cannot reindex. 

Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

Could you share with us the content of the label field on PROD-12718?

Nidhi Prasad May 14, 2020

Capture.PNG

 

SO some of the linked product tickets have a label on them as shown in the screenshot. and i want to extract that list 

Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

You should reindex both Product and Support projects. Since the data is correct, the only explanation for this is that the cache is outdated somehow.

 

if you simply run the subquery provided to the linkedIssuesOf() how many results do you get?

 

project = product and labels = mylabel


Regards

Nidhi Prasad May 14, 2020

No resultCapture.PNG

Jack Nolddor _Sweet Bananas_
Atlassian Partner
May 14, 2020

Try after reindex both projects, problem should be there.

0 votes
Atiq Ahmed May 13, 2020

Try this:

project = support AND (IssueFunction in linkedIssuesOfAll("project =product") AND (project = product AND labels = LabelRequired))

Nidhi Prasad May 13, 2020

Unfortunately, this does not work. 
It does not yield any results. 
But I know I should be able to have a list of issues for it. 

Suggest an answer

Log in or Sign up to answer