Hello, I recently enable script runner and I'm trying to filter for ticket in epics with specific due date. I tried a few JQL like below
issue in allIssuesInEpic("duedate <= '2024-07-01'")
or
parent in issuesInEpics("duedate <= '2024-07-01'")
but jira complains there is no such function as the ones I named.
What do I need to do to enable script runner in JQL? And are those the actual functions for what I am trying to do?
Thank you
Hello @Mircea Craciun
If you have just recently added the app to your instance, you must first execute the Synch function before you can successfully get results from your searches.
https://docs.adaptavist.com/es/latest/get-started/synchronising-keywords
Then, to create a filter that uses ScriptRunner functionality you must go to the Enhanced Search screen available from the Apps menu.
You can't use ScriptRunner functions directly in the View All Issues or other native Jira issue filtering screens.
https://docs.adaptavist.com/es/latest/run-a-search
Next, you need to use the correct function and syntax, which you can find in the app documentation.
https://docs.adaptavist.com/es/latest/run-a-search/jql-functions#issuesinepicssubquery
issuefunction in issuesInEpics("duedate <= '2024-07-01'")
@Trudy ClaspillThank you. I see on the enhanced search window "JQL Sync Status FULLY SYNCED" so I assume that is good.
Running your proposed query there though gets no results, yet we have a lot of epics with due date June 28th 2024 (some in progress, some todo, some done) and all our tickets (bugs, stories, tasks) are assigned to an epic. (also epics with Due Date later than July 1st 2024)
Any idea what could be wrong?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Run the keyword synch then try again.
https://docs.adaptavist.com/es/latest/get-started/synchronising-keywords
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
still no luck
Interestingly, if I try and add the same with the helper, it shows a partial result (there should be more) but when I added that to the list, it still results in 0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have had some oddities with the Enhanced Search sporadically where I have typed in the JQL directly on the screen but it says the JQL is invalid or gives an odd result. I've never figured out why.
But if I use the helper to create the same JQL, then it works.
When using the helper there is a button at the bottom right corner of the helper pop up to add the content of the helper to the query. Have you used that? The pop-up is too big to display entirely on my screen so I have to scroll down to see that button.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I have used the helper that way. Any idea what that "Team managed projects" notification is that is showing up? Clicking on more info just gets me to the blogs, and I don't know how to see if I'm hitting that "wall" or not.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In Jira Cloud there are two over-arching project types - Company Managed and Team Managed. You can find out which type your project is by going to the View All Projects page under the Projects menu, finding your project in the list and looking at the Type column.
The query within the helper dialog gives you the same results as if you ran the identical query (duedate < '2024-07-10') in the regular issue search screen. It is not yet applying any other criteria to it related to the function that you want to use. You can click on the link to see the actual issues it has found based on that portion of the query.
Those results will include all issues of all types in all projects (to which you have access) that match the subquery.
When you then insert that subquery into the function, that applies another layer of criteria. In the case of the issuesInEpics function, you are getting the Epics that match the subquery first, and then getting all the child issues in those Epics as the final results.
However, if any of those Epics are in Team Managed projects, they and their child issues will be excluded.
If you think you have an Epic that matches the subquery, that has child issues that should be in the results set, and that Epic (and the child issues) are not in a Team Managed project, can you share screen images of that Epic showing the due date and the child issues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Mirceao
I don't know if you follow this instruction here on how to add the functions to the JQL search:
https://docs.adaptavist.com/sr4js/latest/features/jql-functions
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I have. But the documentation there is misleading/incorrect. If you read the page it clearly says "You can use ScriptRunner JQL functions anywhere you are able to use Jira JQL functions" So I go to issue search, where I can use Jira JQL, copy the code form their example on that very page that reads
Use issuesInEpic to find all stories for open epics in a project, and then look specifically at the status of issues, such as ‘in progress.’
And I get
If I go to `ScriptRunner Enhanced Search` as suggested by Trudy above, you can see my problem, with the helper showing 31 results but actually running it returning 0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.