Forums

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

JMWE - how to count the number of specific subtask

Rizky.Tuasikal
Contributor
March 13, 2023

How tou count the number of specific subtask?
using JMWE

when submitting from status A to B, it will calculate the specific subtask.

Subtask A

Subtask B

2 answers

2 accepted

3 votes
Answer accepted
Alex Koxaras _Relational_
Community Champion
March 14, 2023

Hi @Rizky.Tuasikal 

I would type something along the following lines:

{% set subTasks = issue | subtasks("key") %}
{{subTasks | field ("fields.issuetype.name")| filter ("Sub-task") | length}}

You can rename the word "Sub-task" inside the filter ("Sub-task") with your own name of subtask

Rizky.Tuasikal
Contributor
March 14, 2023

@Alex Koxaras _Relational_ ,

 

it works Alex !! :)

 

thank you very much, GBU

Rizky.Tuasikal
Contributor
March 14, 2023

hi @Alex Koxaras _Relational_ ,

 

sorry, one more question,

if there is one more condition, where the subtask status that is counted is only the Completed status,

 

then, how to achieve it?

2 votes
Answer accepted
David Fischer
Community Champion
March 14, 2023

Hi @Rizky.Tuasikal 

you can use this script:

{% set subTasks = issue | subtasks("key,status") %}
{{subTasks | filter (["fields.issuetype.name","Sub-task"]) | filter (["fields.status.name","Completed"]) | length}}
Rizky.Tuasikal
Contributor
March 14, 2023

@David Fischer 

thank you, it works for me

GBU too :)

Suggest an answer

Log in or Sign up to answer