issueFunction in another issueFunction

Ivan Mantrov March 25, 2023

I want to close epic automatically when the last issue is closed. The first condition after trigger (closing the issue) is a query wich checks if parent epic contains only closed tasks

issueFunction in issuesinEpics("NOT issueFunction in EpicsOf("status != Closed")")

This query doesn't work and i can't understand why Is it because of the issueFunction putted into another issueFunction? Is there any solution?

3 answers

2 accepted

3 votes
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.
March 25, 2023

Hello @Ivan Mantrov 

Are you working with Jira Cloud or Jira Server/Data Center?

I don't think you need to use the issueFunction option at all, depending on which type of hosting you are using. If you are on Jira Server/Data Center it would also depend on if you are using Automation Lite for Server or Automation for Data Center.

Here is an example of a rule that accomplishes your requirement.

This is valid for Jira Cloud and for Jira Data Center with Automation v8.1

Screen Shot 2023-03-25 at 12.59.44 PM.png

0 votes
Answer accepted
Ivan Mantrov April 1, 2023

Here is the solution from Stack Overflow:

issueFunction in issuesInEpics("NOT issueFunction in EpicsOf(\"status != Закрыт\")")

One should use a backslash before quotes in the function that is nested in another function

0 votes
Oday Rafeh
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.
March 25, 2023

@Ivan Mantrov 

One solution could be to break the query into two separate JQL queries and use them together in your automation.

For example, you could first create a JQL query to find all issues in the parent epic:

 

"parentEpic=EPIC-123"

 

Then you could create a second JQL query to find all closed issues in that epic:

 

"status=Closed AND parent in issuesInEpic('EPIC-123')"

 

Finally, you could use these two queries together in your automation to check if the parent epic contains only closed tasks:

 

issueFunction in issuesinEpics("parentEpic=EPIC-123") AND issueFunction not in issuesinEpics("status not in (Closed) AND parentEpic=EPIC-123")

 

This way, you are not nesting issueFunctions inside each other and the query should work correctly.

 

Let me know the results please. 

Regards 

Oday

Ivan Mantrov April 1, 2023

Thanks for the proposed solution, but I didn't quite understand what "epic-123" means. If you know the name of the epic, then this method may be suitable, but when automating, the name of the epic is not known in advance

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events