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,361,617
Community Members
 
Community Events
168
Community Groups

Is it possible to use 2 hyperlinks without a line break between in a table transform?

I have two separate hyperlinks I am trying to display without using a line break in a single column. The 2 original columns used the following code:

FORMATWIKI((SUM("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]\n"))) AS 'TER Key',

FORMATWIKI((SUM("[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) AS 'SAP Link',

 

I am trying to combine them in a single column and display them in the format :

TER-XXX (DIR XXXXXX) where the TER-XXX is a link to JIRA and DIR XXXXX is a link that opens a SAP link.

 

I tried this:

FORMATWIKI((sum("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]\n" + "[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) as 'test3'

but it inserts a new line after the TER link. Is is possible to get both links on the same line?

2 answers

1 accepted

4 votes
Answer accepted

Hi @Jason Dyke ,

Seems that your solution is right: try to remove the first "\n" character from the query. Then it worked as was supposed for my test table.

FORMATWIKI((sum("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]\n" + "[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) as 'test3'

Hi @Katerina Kovriga _Stiltsoft_ , I had tried that before. 

This is the way it looks with the \n in the code:

image.png

and this is how it looks after removing the \n:

image.png

are there any alternatives to \n that would insert a space or a tab instead of a return?

Please refer to our support - attach the screenshot of your table and the full SQL query from the Table Transformer macro. Smth small is missing, we'll copy exactly your code and "play" with the query to resolve the issue.

This is the code in the table transformer:

 

SELECT T1.'PR Key',T1.'PR Elaborates',T1.'PR Summary',T1.'Document DIR',
T1.'TER Key',T1.'TER Summary',T1.'TER FixVersion',T1.'TER Resolution',

FORMATWIKI(sum(T1.'PR Key' + "\n")) as 'PR Key',
FORMATWIKI(sum(T1.'PR Elaborates' + "\n")) as 'PR Elaborates',
FORMATWIKI(sum(T1.'PR Summary' + "\n")) as 'PR Summary',
FORMATWIKI(sum(T1.'Document DIR' + "\n")) as 'Document DIR',
FORMATWIKI((SUM("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]\n"))) AS 'TER Key',
FORMATWIKI(sum(T1.'TER Summary' + "\n")) as 'TER Summary',
FORMATWIKI(sum(T1.'TER FixVersion' + "\n")) as 'TER FixVersion',
FORMATWIKI(sum(T1.'TER Resolution' + "\n")) as 'TER Resolution',
FORMATWIKI((SUM("[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) AS 'SAP Link',
FORMATWIKI((sum("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]\n" + "[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) as 'test3'

FROM T1

GROUP BY T1.'PR Key',T1.'PR Elaborates',T1.'PR Summary',T1.'Document DIR'

 

This is how the table currently looks:
image.png

Still can't find the root of the issue: to show the difference beautifully I skipped showing several columns from the beginning of the query - then the width of the table on my screen allows to take a good screenshot.

 

So here is my source table with dummy data wrapped in the Table Transformer macro:

Wed 3-1.png

 

Here is my query (copied from yours but without the beginning and grouped only by the first column because I have only 3 rows with data):

Wed 3-2.png

SELECT
FORMATWIKI((SUM("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]\n"))) AS 'TER Key',
FORMATWIKI(sum(T1.'TER Summary' + "\n")) as 'TER Summary',
FORMATWIKI(sum(T1.'TER FixVersion' + "\n")) as 'TER FixVersion',
FORMATWIKI(sum(T1.'TER Resolution' + "\n")) as 'TER Resolution',
FORMATWIKI((SUM("[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) AS 'SAP Link',
FORMATWIKI((sum("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]" + "[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) as 'test2',
FORMATWIKI((sum("[" + T1.'TER Key' + "|https://code.waters.com/jira/browse/" + T1.'TER Key' + "]\n" + "[ (DIR " + T1.'SAP DIR' + ")" + "|http://sapprod1.waters.com:8000/openfile/key?N=" + T1.'SAP DIR' + "&T=" + T1.'SAP DIR Doc Type' + "]\n"))) as 'test3'
FROM T1
GROUP BY T1.'PR Key'

 

The difference between the 'test2' and 'test3' is in the \n character.

 

And here is the result:

Wed 3-3.png

 

The 'test3' column looks like yours, but 'test2' doesn't have an extra return.

 

I'm on Confluence Cloud as is shown via your hashtags. So, please raise a support ticket. Attach your page storage format and the team will look closer at the problem.

[hii]

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
Community showcase
Published in Confluence

Watch 4 Confluence apps compete for Best App Demo in September's Appy Hours

Calling all collaborators! Appy Hours on the Atlassian Community is a monthly event where 4 Partner and app vendor presenters go head-to-head with 5-minute demos for the title of Best App Demo. I...

592 views 0 13
Read article

Atlassian Community Events