Forums

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

how to count the number of subtasks (using JMWE)

Rizky.Tuasikal
Contributor
March 6, 2023

is there a way to count how many subtasks there are? especially using JMWE

 

example: when submitting from status A to B, it will calculate the specific existing subtasks

1 answer

1 accepted

1 vote
Answer accepted
Alex Koxaras -Relational-
Community Champion
March 6, 2023

Hi @Rizky.Tuasikal 

If you want to place a condition inside a post function, then you can write:

 {{ issue | subtasks("key") | length }}

If you place it inside a workflow condition or validator then write:

issue.subtasks.length

Let me know if you got this working!

David Fischer
Community Champion
March 7, 2023

Actually, in Nunjucks (post-functions), you can use this:

{{ issue.fields.subtasks.length }}

which is faster / more efficient.

Like # people like this
Alex Koxaras -Relational-
Community Champion
March 7, 2023

@David Fischer thanx for this suggestion!

Rizky.Tuasikal
Contributor
March 13, 2023

Hi @Alex Koxaras -Relational- / @David Fischer ,

 

it works perfectly!

but, if you want to calculate the specific subtask/issue type (ex: Release PIR),

then how you do it?

 

 

Thanks in advance

Suggest an answer

Log in or Sign up to answer