Forums

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

πŸ‘‰ Sending an Email to the Latest Created Sub-task Using JMWE

Γ–mer GΓΌndΓΌz
February 10, 2026

Hello,

I am creating multiple sub-tasks under a parent task. Since more than one sub-task can be created, I would like to identify the most recently created sub-task and perform an action on it.

Specifically, I want to send an email notification to the latest created sub-task using the Jira Misc Workflow Extensions (JMWE) add-on.

What would be the best approach to achieve this?
Should I use a Nunjucks template, a JQL query, or another JMWE-related method?

Regards

 

 

image.png

image.png

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Aaron Pavez _ServiceRocket_
Community Champion
March 10, 2026

Hi @Γ–mer GΓΌndΓΌz 

The best way to check this is to check the subtasks key. The last will be the higher key.

Do you want to send a notification to the assignee?

Which transition do you want to run this on?

This is what I did:

JMWE post function Email this issue when transition to in progress:

Screenshot_20260310_104435.jpeg 

recipient

Screenshot_20260310_104509.jpeg

Email this issue Text Body

{# Identify the latest subtask by sorting by ID #}
{% set latestSubtask = issue.fields.subtasks | sort(attribute='id') | last %}

{% if latestSubtask %}
<p>Hello,</p>
<p>A new subtask has been finalized for Parent Issue <strong>{{ issue.key }}</strong>.</p>

<h3>Latest Subtask Details:</h3>
<ul>
<li><strong>Key:</strong> {{ latestSubtask.key }}</li>
<li><strong>Summary:</strong> {{ latestSubtask.fields.summary }}</li>
<li><strong>Status:</strong> {{ latestSubtask.fields.status.name }}</li>
</ul>

<p><a href="{{ serverUrl }}/browse/{{ latestSubtask.key }}">View Subtask</a></p>
{% else %}
<p>No subtasks were found for this issue.</p>
{% endif %}

 email i get

Screenshot_20260310_104623.jpeg

Finalized should be something else, but the idea works, right?

Regards!

 

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events