Forums

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

issueFunction in issuesInEpic() function causes issues with starting sprints

Raynard Rhodes
Contributor
May 14, 2021
(issueFunction in issuesInEpics("project = TEST") AND status not in (closed, resolved)) OR (project = TEST AND status not in (closed, resolved)) ORDER BY Rank ASC

 

Above is the JQL I'm using with the added JQL from ScriptRunner. The problem is when using this query on a board users who have manage sprint permissions in the projects are unable to create a sprint. It seems this is because Jira doesn't know what projects are being pulled so the user would need permissions in all the projects. Is there a way to modify this query so Jira recognizes the projects associated? 

2 answers

0 votes
Trudy Claspill
Community Champion
May 14, 2021

I think the issue is actually in

issueFunction in issuesInEpics()

The subquery there is selecting the project that contains the Epics, but the issues in those Epics could be in any project.

It seems like adding the additional clause of 

projects in ("20+ projects listed") AND

...should've addressed constraining the projects in which the child issues would be selected. Are the users still unable to start sprints after you added that clause? Do the users have Manage Sprint permissions on the 20+ projects?

Raynard Rhodes
Contributor
May 14, 2021

Yep the user has permissions for every project that appears in the board.

0 votes
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.
May 14, 2021

The problem is the reading of the second clause in the first set of braces before the OR.  "status not in (closed, resolved)" could return issues from every project in your system.

If you were to add "and project in (list of projects where your people do have the rights for admin)" inside that first brace, then it should work.

Raynard Rhodes
Contributor
May 14, 2021

The "status not in (closed, resolved)" is after an AND statement so it should only apply to the results pulled in from issuesInEpic()

 

I've attempted this as well. After adding all of the projects to the list, it just shows "This board contains 29 projects". But this is because I specifically listed them.

(project in ("20+ projects listed") AND issueFunction in issuesInEpics("project = RODR AND issuetype = EPIC") AND status not in (closed, resolved)) OR (project = RODR AND status not in (closed, resolved)) ORDER BY Rank ASC

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.
May 14, 2021

No, that's not true, it doesn't matter where it falls in the conjunction of the AND.  You've also got the problem that an Epic in Test could also draw in an issue from any project.

You need to explicitly limit the entire query to projects that your people have permissions for.  Might be simplest to take your original query and just say "project in (a, b, c) AND <your query>"

Raynard Rhodes
Contributor
May 14, 2021

Looking at the backlog. There are roughly 58 issues in it (more are added as time goes on). Each respective project the issues reside in the user has Manage Sprint permission. 

I'm not sure what is the difference between what you're telling me at the end and what I've posted above.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events