Forums

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

Iterate thru each comment in each subtask

Carol Borstnik February 12, 2024

*UPDATED*

I'm trying to create a form that prints all of the comments for each subtask on an epic, but I'm missing something

With the statement below for comments, I get the subtask comments displayed, but based on the count of epic comments rather than subtask comments. For example: if there are three comments on the epic, every subtask will have three lines of 'comments' (some comment lines are blank, I can see them because of the dashed divider I have). 

Subtasks #{for subtasks}

Summary

${Subtasks[n].Summary}

Assignee

${Subtasks[n].AssigneeUserDisplayName}

Due Date

${dateformat("MM-dd-yyyy"):Subtasks[n].Due Date}

Closed Date

${dateformat("MM-dd-yyyy"):Subtasks[n].Resolved}

Estimate

${Subtasks[n].OriginalEstimateFormatted}

Notes

 

#{for j=CommentsCount}

${dateformat("MM-dd-yyyy"):Subtasks[n].Comments[j].Created}:  ${Subtasks[n].Comments[j].AuthorFullName}

${Subtasks[n].Comments[j].Body}

--------------------------------

#{end}

 

1 answer

0 votes
Carol Borstnik March 12, 2024

Solved my own issue but posting here anyway:

Subtasks #{for subtasks}

Summary

${Subtasks[n].Summary}

Assignee

${Subtasks[n].AssigneeUserDisplayName}

Due Date

${dateformat("MM-dd-yyyy"):Subtasks[n].Due Date}

Closed Date

${dateformat("MM-dd-yyyy"):Subtasks[n].Resolved}

Work Time

Estimated ${Subtasks[n].OriginalEstimateFormatted} / Actual ${Subtasks[n].Time Spent} seconds

Notes:

#{for j=Subtasks[n].CommentsCount}

${dateformat("MM-dd-yyyy"):Subtasks[n].Comments[j].Created}:  ${Subtasks[n].Comments[j].AuthorFullName}

${Subtasks[n].Comments[j].Body}

--------------------------------

#{end}

 

#{end}

Suggest an answer

Log in or Sign up to answer