Forums

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

Structure Formula - display colored value of a Variable

Uwe Döll June 23, 2022

Hi, 

i am calculating a value, that is saved in my variable "diff". 

I want to show the value of the variable in structure with a colored background. I tried a lot, but instead of the value i only get the Name of my variable. 

Here is a Part of my Formula: 

--------------

with diff = X/Y:

IF diff < 0.5:
//$diff{backgroundColor=red color=white}
":panel[diff]{backgroundColor=red color=white}"
//FORMAT_CAPTION("RED", ":cloud_with_lightning_and_rain:" diff)
ELSE IF diff ...

-------------

In the picture you can see some Results. Instead of "diff" i want to se something like "1,54"...

The "Format_Caption" is a copy-paste from the helping sites - which did not help.

image.png

1 answer

1 accepted

4 votes
Answer accepted
David Niro
Atlassian Partner
June 23, 2022

Hello @Uwe Döll ,

David from ALM Works here.  Welcome to the Community!

Your formula is 99% of the way there.  There are two adjustments we can make to get it working for you.

The first is to define diff as an expression using $ and to enclose the Text Snippet with """.

With those two modifications, your formula should look like this:

with diff = X/Y:

IF diff < 0.5:

""":panel[$diff]{backgroundColor=red color=white}"""

Please let me know if this helps!

Best Regards,
David

Uwe Döll June 23, 2022

Good morning David, 

Thanks for your help. It works exactly how i want it to :-)

Best Regards, 

Uwe

image.png

Like # people like this
David Niro
Atlassian Partner
June 24, 2022

You are very welcome, @Uwe Döll !  So glad to hear it was the right solution for you!

Best,
David

Like Dave Rosenlund _Trundl_ likes this
Stavros December 13, 2024

Thanks for the great answer, @David Niro
 It´s still helpful, fyi :) 

Like Stepan Kholodov _Tempo_ likes this

Suggest an answer

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

Atlassian Community Events