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
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.