We are looking to use Project Automation to reopen the most recently closed sub-task when the Parent transitions from Resolved > In Progress.
To identify the most recently updated sub-task, I'm using "issue in limitedResults("Project=[ProjName]","1") ORDER BY updated DESC" from the Go! JQL add-on, but I can't figure out how to apply the transition to the resulting subtask. Below is what we've built to-date:
Any suggestions would be appreciated
If I'm not mistaken, the second condition return all the issue from the project but limit the number of result to 1, returning the lat updated issue of the project.
It do not seems to be what you are looking for.
You are looking for something more like project = RQMTEST and parent = {{triggerIssue.key}} if it support that.
Regards
This worked perfectly, thanks! I updated the If: Issue matches JQL to the following:
issue in limitedResults("parent = {{triggerIssue.key}}","1") ORDER BY updated DESC
Is there a reason (possibly best practice?) to include the project in the query? I tested with and without and didn't notice a difference in the time taken to complete the automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure, in this case parent field is already limiting the scope to the project the trigger issue is in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After some testing the query above didn't quite work as desired. Because the ORDER BY function occurs after the limtedResults function and not simultaneously, the query always returns the same result. We have tried to put the ORDER BY function in the limitedResults function, but the automation fails which works in a simple JQL search. However, when moved into the automation with the Smart Value it fails.
We updated the query to
issue in limitedResults("parent = ({{triggerIssue.key}}) ORDER BY updated DESC","1")
And the automation returns the following error:
(key IN (RQMTEST-174) AND (issue in limitedResults("parent = (RQMTEST-171)))" - Error in the JQL Query: The quoted string 'parent = (RQMTEST-171)))' has not been completed. (line 1, character 52)
Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure if it's the cause of the issue but the JQL is not valid
issue in limitedResults("parent = ({{triggerIssue.key}}) ORDER BY updated DESC","1")
It should be
issue in limitedResults("parent = {{triggerIssue.key}} ORDER BY updated DESC","1")
() are not supported after =
Reagdrs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies, you're right, I was testing to see if the ( ) would fix the error, but it did not. Removing them also does not fix. I'm still getting this error:
"(key IN (RQMTEST-174) AND (issue in limitedResults("parent = RQMTEST-171))" - Error in the JQL Query: The quoted string 'parent = RQMTEST-171))' has not been completed. (line 1, character 52)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Weird what is the JQL with the smartvalue and an example of what it's translated into ?
Because in the error message there is a missing "
"(key IN (RQMTEST-174) AND (issue in limitedResults("parent = RQMTEST-171))"
A " should be after the issue key RQMTEST-171
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's how I'm reading it as well. I tried adding a single quote separately before and after the smart value with no luck.
This works perfectly fine in the advanced search JQL and returns one row, RQM-174, which is the correct row.
issue in limitedResults("parent = RQMTEST-171 ORDER BY updated DESC","1")
I'm working with RQMTEST-171, where RQMTEST-172 through RQMTEST-177 are subtasks and RQMTEST-174 is the last updated.
But when I move the exact same string pre-identifying the parent task instead of using the smart value, I get a different set of errors that makes even less sense than the prior:
RQMTEST-171: "(((parent = RQMTEST-171) AND (issue in limitedResults("parent = RQMTEST-171)) AND (key != RQMTEST-171)) AND (project in (25700))" - Error in the JQL Query: The quoted string 'parent = RQMTEST-171)) AND (key != RQMTEST-171)) AND (project in (25700))' has not been completed. (line 1, character 55)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Weird have you try to use ' instead " or escape the " using \" ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried ' instead of " but didn't see any changes.
After reading into the error a bit more, I see that it's trying to end the limitedResults("","") function immediately following the {{triggerissue.key}} at the first space rather than at the double quotes. I've tried to build a layered call, but since it's so simple it just isn't working. I even duplicated the initial request in the query to determine if it was the space that was causing the issue. It's not, the function is trying to end before ORDER BY
issue in limitedResults("parent = {{triggerissue.key}} AND parent = {{triggerissue.key}} ORDER BY updated DESC", "1")
returns this:
(key IN (RQMTEST-174) AND (issue in limitedResults("parent = RQMTEST-171 AND parent = RQMTEST-171))" - Error in the JQL Query: The quoted string 'parent = RQMTEST-171 AND parent = RQMTEST-171))' has not been completed. (line 1, character 52)
No idea why it's doing that.
I'm not familiar with the \ escape character. Can you suggest how I would use it? Tried a few things and couldn't get it to work properly in the advanced search.
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.