Event-based actions - issue hierarchy scope

The following use cases use JQL Search Extensions (JSE) hierarchy recursive functions to set the scope for an event-based action in JMWE.

Recursive functions
When you want the scope of your search filter to apply to the hierarchy above or below the initial query, you can use JSE’s ParentsOfIssuesInQueryRecursive() or ChildrenOfIssuesInQueryRecursive() functions. For example, you can copy a comment from an epic to all the corresponding stories and their subtasks.

When an issue is updated, add a comment on all parent issues

JSE function

ParentsOfIssuesInQueryRecursive()

JMWE event

Issue Updated

JMWE action

Comment Issues

Method

  1. In JQL Extended Search, perform a search for parent issues matching a given query, for example:

    issue in parentsOfIssuesInQueryRecursive("project='ACME' and status=Approved")

     

    Screenshot of the Extended Search page in JSE with the query as described on this page.

     

  2. Save the query as a filter. For this example, the filter is called JSE-ACME-parents of approved.

  3. In JMWE, create or edit an event-based action to use the Issue Updated event.

  4. Set the scope to Only apply to issues that match a JQL filter.

  5. Click the JQL input box, then search using the filter name, for example, filter="JSE-ACME-parents of approved".

  6. Click Save. The filter is added to your event-based action configuration.

  7. Add the Comment issues post function.

  8. Save the action.

    Screenshot of the configured JMWE Issue Updated event as described on this page.

    Now, when an issue meeting the JQL filter criteria is updated, the comment configured for step 7 is added to the issue. You can apply the same use case to other events, for example, Issue Deleted.

When a parent issue is closed, add a comment on all matching child issues

JSE function

ChildrenOfIssuesInQueryRecursive()

JMWE event

Issue Closed

JMWE action

Comment Issues

Method

  1. In JQL Extended Search, perform a search for child issues matching a given query, for example:

    issue in childrenOfIssuesInQueryRecursive("project='ACME' and type=Epic and status=Closed")

     

  2. Save the query as a filter. For this example, the filter is called JSE Children of Closed Epics.

  3. In JMWE, create or edit an event-based action to use the Issue Closed event.

  4. Set the scope to Only apply to issues that match a JQL filter.

  5. Click the JQL input box, then search using the filter name, for example, filter="JSE Children of Closed Epics".

  6. Click Save. The filter is added to your event-based action configuration.

  7. Add the Comment issues post function.

  8. Save the action.

    Now, when an Epic is closed, the comment configured for step 7 is added to the issues meeting the JQL filter criteria.