JQL

ADENUGES2282 April 4, 2023

Hi All,

I think my query may be botched. Please see below.

issueFunction in subtasksof("project=AAAA and issuetype in (\"TASK\") AND created (\"20/mar/23\")AND status not in (Cancelled, \"On Hold\")

 

I am looking for a query to pull a subset of all the subtask assigned to my team example (March 2023 & April 2023),  

2 answers

2 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2023

Hello @ADENUGES2282 

Welcome to the Atlassian community!

How is the query not giving you the results that you want? What is it including that you think it should not? What is it excluding that you think it should include?

"issueFunction in subtasksOf()" will give you the subtasks of the issues that match the criteria in the parentheses. What you have in the parentheses is

project=AAA and issueType=Task and created(20/mar/23) and status not in (Cancelled, "On Hold")

That query would give you all the Task in project AAAA which are in statuses other than Cancelled or On Hold, and where the Task creation date has some relationship to "20/mar/23".

However the syntax concerning the Creation Date is not valid syntax:

created(20/mar/23)

What are you trying to accomplish with that criteria? Are you looking for Tasks that were created on that date, or after that date, or something else?

After getting that syntax corrected you will have a list of tasks returned by that part of the query.

Then the "issue in subtasksOf()" will give you all the subtasks under the Tasks.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2023

When I try by date created (\"20/mar/23\")") it returns nothing though I know 3 tasks with 69 subtasks were created on that day

That is because that is not valid syntax.

Also note that the Created value is a date and time. You need to consider that in your JQL.

If you want issues created on a specific date then you need:

created > "20/mar/23" and created < "21/mar/23"

 If you want issues created in a date range you need to specify that date range:

created > "20/mar/23" and created < "20/apr/23"

Fixing that will give you all the Tasks created in that date range in that project that are currently not Cancelled or On Hold.

When you use that subfilter with subtasksOf you will then get all the subtasks associated with those tasks.

If you want to only see subtasks that are currently in progress then you need to add that criteria to your filter also:

issue in subtasksOf(<your subfilter>) and status not in (Cancelled, "On Hold")

The criteria inside the subtasksOf parentheses are applied to the parent issues being selected. The criteria you add outside of the parentheses will apply to the subtasks retrieved for those parent issues.

 

IMPORTANT NOTE: these filters are looking at the current status of the issues. They are not looking at the status the issues were in during your specified date range.

If you want to get the issues in the specified statuses during your specified date range that would require using the WAS IN (or WAS NOT IN) operator with the DURING predicate.

0 votes
Answer accepted
Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2023

Hi @ADENUGES2282 

Welcome to the community.

You can use subtasksof function if you want to provide parent criteria. I couldn't catch the requirement clearly. Do you want to see subtasks or parents? Also, how do you define your team? A set of assignees or a cf?

Also take a look at Script Runner functions page.

ADENUGES2282 April 4, 2023

Thanks  both community leaders for replying.

When I try by date created (\"20/mar/23\")") it returns nothing though I know 3 tasks with 69 subtasks were created on that day

Yes I would like to see all tasks and subtasks created and in progress for a given period e.g  from 03/20/23 till date or at least on a monthly or quarterly basis. 

My Team - referring to my project team.

Hope this helps clarify.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events