How to display icons in structure formula

Pradeep Nair February 7, 2018

Once I create a formula to display a standard field, it seems i am not able to retain the display icons for them. For e.g. if i were to create a standard column "Status" I can see Open/In Progress/Done etc in their native icons or display style. But if i put them in a formula and still reference the same field, it displays plain text. Is there a way for the structure to display it the same way as the native field?

for e.g.

Status Column vs If(issueType = "Task"; Status;if(issueType = "Story";""))

1 answer

1 accepted

1 vote
Answer accepted
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2018

Hi Pradeep,

Great question, thanks! Currently, a formula column would display only a text or a number or a date. That is because once you start using a Jira value (the Status, in your case), it becomes a text. 

There's an open feature request to let Formula column display some HTML or a markup, in order to provide more colorful display of the value. Your request to display the status as an icon is similar -- I will add more details to that feature request.

Watch out for new releases of Structure and thanks for using our product!

Kind regards,
Igor

reimer_prochnow July 13, 2022

Hi Igor, I have the same question, but your answer seems outdated, since formulars are able to display markup now.

But how can I reference the native icons (or better to say the correct styles)?

I can output markup but this will end up in emulating the original styles inside an if clause.

Is there an easier way to accomplish this?

David Niro
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 13, 2022

Hello @reimer_prochnow ,

David from ALM Works here.  Welcome to the Community!

As far as I am aware, it is not possible to reference the native format.  Emulating the original style is the only way to accomplish the goal. 

Using a Local Variable, we can make the set up of the IF Conditional statement much easier though:

With FORMAT_STATUS (bordercolor,bgcolor,color,value) = 
"""{panel:borderStyle=solid|borderColor=$bordercolor|bgColor=$bgcolor}{color:$color}*$value*{color}{panel}"""
:

IF STATUS = "OPEN":
FORMAT_STATUS("blue","blue","white",status)
ELSE IF STATUS = "TO DO":
FORMAT_STATUS("red","red","white",status)
ELSE:
FORMAT_STATUS("purple","purple","white","N/A")

The Local Variable "With FORMAT_STATUS..." defines the general format you want to use and then for each of the IF conditional statements, you just need to enter the colors for border, background and text.

Please let me know if this helps. I look forward to your feedback.

Best,
David

reimer_prochnow July 14, 2022

Thank you David, especially for the hint with the"FORMAT_STATUS"

Actually I ended up extracting the original colors from css and I am quite happy with it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events