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

colour table row formatting depending on status macro

Martin Niederberger January 18, 2023

With the macro table transformer I would like to change the colour of the row of the table depending on the status that is set at the first cell of each row. 

2023-01-18 15_10_04-Kopie von Pendenzenübersicht - Martin Niederberger - Inside.png

For example: If the status is yellow with title "In Bearbeitung" then the entire row should be displayed in light yellow. If the status is red with title "Offen" then the entire row should be displayed in light red an so on...

What would be the sql query for this case?

Any help is highly appreciated!

1 comment

Comment

Log in or Sign up to comment
Katerina Rudkovskaya _Stiltsoft_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 19, 2023
Like # people like this
Martin Niederberger January 19, 2023

Hello @Katerina Rudkovskaya _Stiltsoft_ 

Thank you for your answer. I have already checked this site but didn't get further as there is no example for my use case (condition depending on status macro to colour the entire row). Since I am not experienced in SQL queries, I was hoping someone could help me with this case.

Katerina Rudkovskaya _Stiltsoft_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 19, 2023

It seems that your case and the case in our documentation are alike. Statuses are considered as plain text for the conditions (it doesn't matter what color is the lozenge, only the title matters) and it also doesn't matter if you need to color one column or several - it is done separately column by column.

Maybe this example will make more sense:

SELECT T1.'Status',
FORMATWIKI("{cell:bgColor=" +
CASE WHEN T1.'Status' = "NEW" THEN "Red"
WHEN T1.'Status' = "OLD" THEN "Yellow"
ELSE "Grey"
END
+"}" + T1.'Output' + "{cell}")
AS 'Output',
FORMATWIKI("{cell:bgColor=" +
CASE WHEN T1.'Status' = "NEW" THEN "Red"
WHEN T1.'Status' = "OLD" THEN "Yellow"
ELSE "Grey"
END
+"}" + T1.'Comments' + "{cell}")
AS 'Comments'
From T1

Thu 4-1.png

Like # people like this
Martin Niederberger January 19, 2023

Thank you, that worked perfectly!

Like # people like this
TAGS
AUG Leaders

Atlassian Community Events