Scriptrunner: using multiple issueFunction clauses in the same JQL query

Aquarius
Contributor
December 9, 2024

Dear Experts,

I am using the query  that works fine and Returns Result. 

project = AAA AND type = Epic AND component in (XXX)
AND issueFunction in dateCompare("", "Target end > duedate")

But as soon as I change it to:

filter= YYY
AND issueFunction in dateCompare("", "Target end > duedate")

,where YYY = issueFunction in portfolioChildrenOf("filter = 'ZZZ'")

it works fine but returns No Result

Can you tell me what is wrong and which workarounds are possible?

1 answer

2 votes
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.
December 9, 2024

Hello @Aquarius 

If you execute just:

filter=YYY

...do you get results?

And, if so, have you confirmed that within those results there are issues that meet the criteria of ...?

issueFunction in dateCompare("", "Target end > duedate")

Aquarius
Contributor
December 9, 2024

Yes, sure @Trudy Claspill 

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.
December 9, 2024

Does that mean you did test the YYY filter by itself, and you did confirm it has results that meet the criteria of the dateCompare function?

Aquarius
Contributor
December 9, 2024

Yes of course, @Trudy Claspill 

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.
December 10, 2024

What is the JQL of your filter ZZZ?

 

I recreated the structure of your filters, and I did not encounter the same problem, but that could be because my filter TrudyTestFilterZ is not comparable to your filter ZZZ.

issueFunction in dateCompare("", "Target start >= Target end")
I found two issues with this filter where the issues are Epics that are children of a higher level issue - ABC-123

TrudyTestFilterZ:
key=ABC-123

TrudyTestFilterY:
issuefunction in portfolioChildrenOf("filter='TrudyTestFilterZ'")

Final filter:
filter='TrudyTestFilterY' and issueFunction in dateCompare("", "Target start >= Target end")

The final filter returned 2 issues

I am working with Jira DC 9.12.12 and Scriptrunner 8.35.0.

 

Suggest an answer

Log in or Sign up to answer