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 edited

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
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events