I am using Jira cloud. We have Scriptrunner Enhanced Search. I have 2 projects.
Project 1 - Lets call pr1
Project 2 - Lets call pr2
I have a list of pr1 tickets (pr1-1, pr1-2 etc) and out of these tickets, I want to find the tickets that have a link to pr2 project.
In my scriptrunner enhanced query, I am doing the following
key in (pr1-1, pr1-2) and issueFunction IN linkedIssuesOf("project = pr2")
I get 0 results eventhough pr1-1 has a link to pr2.
Anything wrong in my query ?
Hi @Ashbal
Like @Trudy Claspill mentioned, it is working for me as well and nothing wrong with the query.
Please double-check the ticket keys you have given in the query.
Thanks,
Vamsi
The function is working correctly for me.
Can you provide a screen image that shows the Linked Issues section for one or more of the "pr1" issues from your list, showing that it is linked to an issue in the "pr2" project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So in my example,
pr1-1 ticket has a link to pr2 project. The link in pr1-1 is shown below
The query that i am running in Scriptrunner is
key in (pr1-1) and issueFunction IN linkedIssuesOf("project = pr2")
and i get 0 results when I expect the result to show pr1-1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There doesn't appear to be anything wrong with your filter.
Are PR1 and PR2 projects Company Managed or Team Managed?
What happens if you remove the "key in..." clause? Does the output include pr1-1? Do you get any issues at all in the output?
Maybe you have a typo somewhere in the keys in your list or in the "project=" subquery. Can you show us the actual values for these items?
I've done the same in my environment, and it is working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here are my real values
pr1 = RLP
pr2 = PCSUP
1. Here you can see RLP-87409 is linked to a PCSUP ticket
2. But when I run this query , I am supposed to see RLP-87409 in the results because it is linked to a PCSUP ticket but I get 0 results
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What if you remove the "key in" clause and have just the issueFunction clause? Does RLP-87409 appear in the results?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I removed "key in" and get nothing
I also tried issueFunction in linkedIssuesOf("project = PCSUP")
with and without space between project and PCSUP
Should I add anything else in the subquery to get data ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are the projects Company Managed projects or Team Managed projects?
Is just one type of link used or multiple types of links? I see in your first image that the "pr-1" issue has a "clones" link to the "pr-2" issue. Is Clones the only link type used between the issues you expect to see in the results?
I have tried to recreate this with the Clones link using issues in two Company Managed projects, and in two Team Managed projects, and have not been able to recreate the issue.
At this point I would recommend that you engage Atlassian Support or Adaptavist ScriptRunner support to investigate more.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Both pr1 and pr2 projects are company managed
Some pr1 tickets are linked to pr2 project via "clones"
Some pr1 tickets are linked to pr2 project via "relates to"
Here is something that I found (these are real project values)
If I run this search, I get results
project = RLP and issueFunction in linkedIssuesOf("project = PCSUP and status != done")
But If I run
project = RLP and issueFunction in linkedIssuesOf("project = PCSUP") , I get no results
So, I need to add an "and" clause inside linkedIssuesOf to get any result, but, I dont want to put any clause other than project inside "LinkedOfIssues"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is really odd. I don't have to do that.
I think Adaptavist Support might be your best help at this point.
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.