return all tasks,story if its epic's TargetEndDate is between two dates

Shachi Prasad May 15, 2024

So, I have a list of 25 epics. Out of these, I am trying to list all issue types (task, story, subtask) if the epic's TargetEndDate is between two dates say Feb 1 to April 30.

I have tried: 

"Target End Date" >= 2023-11-01 AND "Target End Date" <= 2024-01-31 AND parent in (A-1234, A-5678, A-9129) ORDER BY status ASC

"Target End Date" >= 2023-11-01 AND "Target End Date" <= 2024-05-31 AND issueFunction in epicsOf("parent in (A-1234, A-5678, A-9129)") ORDER BY status ASC

1 answer

1 accepted

1 vote
Answer accepted
Laurie Sciutti
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2024

Hello @Shachi Prasad and welcome to the Community!  If you use ScriptRunner, the following should work:

 

issueFunction in issuesInEpics("'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31")
Shachi Prasad May 15, 2024

this will search all the epics. I want the query to search only from the given list of epics

Shachi Prasad May 15, 2024

If I add the list of epics, it doesnt return anything.

issueFunction in issuesInEpics("'Epic Link' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31")

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2024

@Shachi Prasad  Are you in Cloud or data center?

If in DC:

issueFunction in issuesInEpics("'Epic Link' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31")

If in Cloud:

issueFunction in issuesInEpics("'Parent' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31")

If still issues, try to first find the epics. Does any of below query give you data?

'Epic Link' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31

OR

'Parent' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31

Cause if above query is not give you Epics, obviously issuefunction will not return any stories.

Shachi Prasad May 16, 2024

This returns data:

'Epic Link' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31

but when I surround it with issueFunction, it doesnt.

issueFunction in issuesInEpics("'Epic Link' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31")

Shachi Prasad May 16, 2024

Also, I am trying to get all the tasks and stories under an epic if the target end date is given within the desired date range but tasks and stories under that epic may or may not have the value for target end date.

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2024

Hello @Shachi Prasad 

Apologies. If A-1234 etc are Epics, your query should be:

'key' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31

AND

issueFunction in issuesInEpics("'key' in (A-1234, A-5678, A-9129) AND 'Target End Date' >= 2023-11-01 AND 'Target End Date' <= 2024-01-31")

I dont know what I was thinking before.

Above query should get you stories/tasks belonging to epics A-1234 etc which have target date in the range you have mentioned.

 

Like Laurie Sciutti likes this
Shachi Prasad May 16, 2024

that worked. Thanks a bunch.

Suggest an answer

Log in or Sign up to answer