Forums

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

How to counts the number of times a specific value is selected? (using JMWE)

RIZKY JTUASIKAL
Contributor
April 12, 2023

Counts value.PNG

 

The example is like the picture above, 

I have 5 subtasks, and I have a Rollback field with the value Yes or No.


The question is,

How do I calculate that there are 5 subtasks that have a value of YES for Rollback field?
When moving from status A to status B

Need help..

Thank you :)

 

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
April 12, 2023

Hi @RIZKY JTUASIKAL 

During that transition from status A to B, are you trying to do that calculation in a post function or in a condition or validator? The solution is different because the scripting language is different (Nunjucks vs Jira Expressions)

RIZKY JTUASIKAL
Contributor
April 12, 2023

Hi @David Fischer ,

thanks for replying.



I will probably use the post function.

Can this be use by using Set Issue Field?

David Fischer
Community Champion
April 13, 2023

Hi @RIZKY JTUASIKAL 

yes, you can use a Set Issue Fields post function, and the Nunjucjs value you want should be something like:

{{issue | subtasks("customfield_12345") | filter(["fields.customfield_12345.value","Yes"]) | length }}

where you'll replace customfield_12345 with the custom field ID of the Rollback field (which you can find on the Issue Fields help tab)

Like RIZKY JTUASIKAL likes this
RIZKY JTUASIKAL
Contributor
April 13, 2023

Hi @David Fischer ,

 

it works :)

thanks again for helping us, GBU

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events