Forums

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

JMWE create tasks iterating through results of a query

Ahmad Sidawi
Contributor
July 3, 2023

Hi, 

 

I'd like to create a SearchIssues query for multiple issue creation and haven't had any luck. 

 

{{("project = XYZ and issuetype = 'Test Run' and cf[10500] = " + issue.key + " and subTasksCount > 0 and status != Obsolete and 'Test Run Type[Select List (cascading)]' = 'Design Validation'") | searchIssues(maxResults = 1) | field( "key") | issue | subtasks( "*all" )}} 

 

I'm trying to get the first issue from the query, then return its subtasks so i can iterate through those. I get the error 'issue only available on an object'. The query works in isolation without the 'issue and subtasks' part. Any ideas? 

1 answer

1 accepted

1 vote
Answer accepted
Sayed Bares _ServiceRocket_
Community Champion
July 3, 2023

@Ahmad Sidawi can you try the following and see if it works:

{{("project = XYZ and issuetype = 'Test Run' and cf[10500] = " + issue.key + " and subTasksCount > 0 and status != Obsolete and 'Test Run Type[Select List (cascading)]' = 'Design Validation'") | searchIssues(maxResults = 1) | field("key")|string|issue|subtasks}} 
Ahmad Sidawi
Contributor
July 5, 2023

Awesome, i was close! Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events