Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,888
Community Members
 
Community Events
184
Community Groups

ALM Structure: Count specific comments and visualise them as a multi bar

Hello
our Jira comments start with status-.
Afterwards there are, for example, the values BA and BR, i.e. Status-BA.
These entries can be repeated.

In the sense of a trend, we would like to have the hits BA and BR increase in the sense of a Wiki Markup Multi Bar.

Unfortunately, this formula is unsuccessful:

With Status_Match =
comments.FILTER($.MATCH("/\Astatus-/")) :

With String = IF Status_Match:
Status_Match.map(
CONCAT(
substring($.body,7,9))
) :

with granularity=20: with bar = "█":

with BA=FLOOR(COUNT#truthy{String="BA"}/COUNT{1}*granularity): with BR=FLOOR(COUNT#truthy{String="BR"}/COUNT{1}*granularity): with BG=FLOOR(COUNT#truthy{String="BG"}/COUNT{1}*granularity): with other=granularity-BA-BR-BG:

//Bar chart

CONCAT("{color:red}",REPEAT(bar, BR),"{color}{color:orange}", REPEAT(bar, BA),"{color}{color:green}", REPEAT(bar, BG),"{color}{color:gray}", REPEAT(bar, other),"{color}")

1 answer

1 vote
Nicholas Ellis _ALM Works_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Aug 17, 2022

Hi Jochen,

This formula is actually really close.  The problem you are running into is scope.  When you define String at the top it is in the main scope, but when we use an aggregation function like COUNT{}, we enter into a new scope where that variable is no longer accessible.  All we need to do to fix it is define our variables inside the scope of the aggregation functions.  This makes the code a bit redundant, but it works.  Here is my working example.

with granularity=20: with bar = "█":

with BA=FLOOR(COUNT#truthy{
With Status_Match =
comments.FILTER($.MATCH("/\Astatus-/")) :
With String = IF Status_Match:
Status_Match.map(
CONCAT(
substring($.body,7,9))
) :
String="BA"
}/COUNT{1}*granularity):

with BR=FLOOR(COUNT#truthy{
With Status_Match =
comments.FILTER($.MATCH("/\Astatus-/")) :
With String = IF Status_Match:
Status_Match.map(
CONCAT(
substring($.body,7,9))
) :
String="BR"
}/COUNT{1}*granularity):

with BG=FLOOR(COUNT#truthy{
With Status_Match =
comments.FILTER($.MATCH("/\Astatus-/")) :
With String = IF Status_Match:
Status_Match.map(
CONCAT(
substring($.body,7,9))
) :
String="BG"
}/COUNT{1}*granularity):

with other=granularity-BA-BR-BG:

//Bar chart

CONCAT("{color:red}",REPEAT(bar, BR),"{color}{color:orange}", REPEAT(bar, BA),
"{color}{color:green}", REPEAT(bar, BG),"{color}{color:gray}", REPEAT(bar, other),"{color}")

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events