The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Trudy P Claspill
Community Champion
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 P Claspill 

Trudy P Claspill
Community Champion
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 P Claspill 

Trudy P Claspill
Community Champion
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.