Hello,
I am trying to write a query to get all the Jira tickets in a first-level project (here PRJ1) that are linked to second-level projects tickets which (these last tickets) were last updated (with a status transition or a comment and so on) more than 3 months ago.
The query I have written so far is:
project = PRJ1 AND status = "Passed to Dev" AND issuetype in (Bug, Incident, Problem, Task) AND issueFunction in linkedIssuesOf("issueFunction in lastComment("before -3M")", "To fix") AND issueFunction in linkedIssueOf("issueFunction in lastUpdated("before -3M"))", "To fix") ORDER BY updated
Nevertheless, Jira informs me that:
Error in the JQL Query: Expecting ')' or ',' but got 'before'. (line 1, character 142)
How can the linkedIssueOf feature be used with lastComment and lastUpdated subqueries? I am aware that the syntax should be:
linkedIssuesOf(Subquery, [link name])
Thanks a lot in advance.
Hi @Stefano D_Angelo and welcome to the Community!
Have you tried replacing the double quotes in your lastcomment() or lastupdated() sections with single quotes?
project = PRJ1 AND status = "Passed to Dev" AND issuetype in (Bug, Incident, Problem, Task)
AND issueFunction in linkedIssuesOf("issueFunction in lastComment('before -3M')", "To fix")
AND issueFunction in linkedIssueOf("issueFunction in lastUpdated('before -3M'))", "To fix")
ORDER BY updated
Hope this helps!
Hello @Walter Buggenhout , thank you very much for your fast help!
I have been able to follow your suggestion and modify the Jira query using the single quotes in the lastComment condition (but not in the lastUpdated one - that can be disregarded for now), therefore the query now is:
project = PRJ1 AND status = "Passed to Dev" AND issuetype in (Bug, Incident, Problem, Task) AND issueFunction in linkedIssuesOf("issueFunction in lastComment('before -3M')", "To fix") ORDER BY updated DESC
Nevertheless, although the query is now syntactically correct, the results show PRJ1's tickets linked to 2nd-level projects' tickets whose comments are newer (and not older) than 3 months.
I have already tried also with 'before 3M' or 'after -3M' but still no success.
Is there any chance you can help further?
A thousand thanks again for your support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hadn't paid much attention to that part of your query, but M for months does not exist as far as I know. You can use "w" for weeks or "d" for days instead. M is used for minutes (although it is normally spelled with a small 'm').
I would replace before -30M with before -90d. It is not entirely correct, but should come pretty close!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Walter Buggenhout, I referred to some other documentation where it says 'M' could stand for months but I might have misread it!
Thank you so much, now it works!
One last question (if possible): how could I include all the link types (or at least more than just one) in the linkedIssueOf argument and not just To fix?
Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to include all link types, you can just omit the "to fix" parameter from the query. However, if you want to retrieve multiple specific link types, you might have to combine multiple issuefuntion in linkedIssuesOf() statements, where you specify the desired link type separately.
If that's the case, then be very careful to use parentheses in the right places for consistent results.
Good luck with that last bit!
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.