Forums

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

Include Confluence username in transformed table

Noori Fathima August 16, 2022

I have a transformed table and based on CASE scenario we have to add a userid in the column. But we cant use this in the transformed table (SQL query) as it would in the regular table added in confluence 

SELECT CASE WHEN T2.'Labels' LIKE "%Bug%" THEN @userid 

T

2 answers

1 accepted

0 votes
Answer accepted
Noori Fathima August 16, 2022

Hi @Katerina Kovriga _Stiltsoft_ ,

 

Thanks for your response. I'm looking to add the user in the column in tagged form which looks like @Katerina Kovriga with a link to your profile like  https://confluence.abc.com/display/~kkovriga

Katerina Kovriga _Stiltsoft_
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.
August 16, 2022

Oh, I see - unfortunately it can't be done naturally. The @ symbol won't be recognized.

I can suggest the following workaround:

SELECT *,
CASE WHEN T1.'Project' LIKE "%Pr1%"
THEN FORMATWIKI("[Kovriga|" + "https://confluence.stiltsoft.com/display/~kkovriga" + "]")
END
AS 'Person'
FROM T*

Here you create the full link to the required profile manually. In my example it's https://confluence.stiltsoft.com/display/~kkovriga.

The link will be renamed as Kovriga for my example. It will be shown like an ordinary Confluence link (blue and with underline while mouse hovering). The short name of the link can be changed to @kkovriga, assignee, etc., of course.

Noori Fathima August 17, 2022

Hi @Katerina Kovriga _Stiltsoft_ ,

I have already implemented the above solution but the blue hyperlink stands-out from the remaining data in the column which is in tagged form as they are not part of the CASE scenario.  Just wanted to achieve the uniformity. 

Katerina Kovriga _Stiltsoft_
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.
August 17, 2022

It is supposed to be so because we create a native Confluence link as a workaround.

The standard @ symbol won't be recognized by the Table Transformer macro as a functional user @mention.

Noori Fathima August 18, 2022

Thanks. Marking it as answer

4 votes
Katerina Kovriga _Stiltsoft_
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.
August 16, 2022

Hi @Noori Fathima ,

The Table Transformer macro supports the @CURRENTUSER variable, for example, in a query like this:

SELECT CASE WHEN T1.'Col A' LIKE "%China%"
THEN @CURRENTUSER
END
AS 'New'
FROM T*

Here if the string in the column "Col A" includes "China", then my name will be assigned to this row in the "New" column. For example, my username in Confluence is @kkovriga, it corresponds to Katerina Kovriga, so I'll see Katerina Kovriga in the "New" column.

If somebody else visits this page, he/she will see their own name (as now they are logged into Confluence).


What concerns your case, you may use simple strings to set different names for your colleagues:

SELECT CASE WHEN T1.'Col A' LIKE "%China%"
THEN "Katerina Kovriga"
WHEN T1.'Col A' LIKE "%USA%"
THEN "John Smith"
END
AS 'New'
FROM T*

Hope this helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events