Forums

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

Structure: commens from subtask

Alexandra Kolesova June 24, 2025

Hello everyone!
I am writing a formula that finds the last subtask of a certain type in a task and want to output comments from this subtask. Is it even possible to do this?

WITH getSubtaskComments() = (
  WITH lastSubtask = SORT_BY(
      SPLIT(subtasks, ',').MAP(issue($)).FILTER($.issuetype = 'Subtask'),
      $.startDate
    ).LAST():

  issue(lastSubtask).comments // i tried this, but it's not working
):

IF issuetype == 'Task':
    getSubtaskComments()
ELSE:
    undefined

 

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Stepan Kholodov _Tempo_
Community Champion
June 24, 2025

Hello @Alexandra Kolesova 

The Formula can't access the comments of Sub-tasks through their parent Task, so you would need to have the parent Task and all its Sub-tasks added in the structure. You can do it using the Insert generator and the Sub-tasks Extend generators.

Once the issues are added and the hierarchy is visualized, you can use a formula like this:

if issuetype = "task": max#children{comments.filter($.created = parent{if issuetype = "task": max#children{comments.created}})}

It will return the latest comment from all Sub-tasks, and show it for the parent Task.

I hope this helps. If you need further assistance here or if you have other questions about Structure, please reach out to us directly at our support portal.

Best regards,
Stepan
Tempo (the Structure app vendor)

DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events