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

How do I return query results as a comma separated list in SQL?

Laurie Huth April 6, 2022

Issue: I am using the Jira Issue/Filter macro in a Confluence page. In Jira, there is a list of items selected. I want to have commas or semi commas when I pull it into Confluence. 

For example, currently in Jira there is an External Document field:

Screenshot 2022-04-08 100405.png

Then the table cell in Confluence shows: (note, no commas or anything to separate the list)

Screenshot 2022-04-08 100526.png

 

Question: How do I enter commas or semicolons or something to separate each item?

 

Here is my SQL so far: 

FORMATWIKI(SUM("External: " + 'External Document')) AS 'Resources'

 

 

 

2 answers

2 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.
April 8, 2022

Hi @Laurie Huth ,

If I got the case right, in the original table coming from the Jira Issues macro you have a plain row of words without any separations:

|Client Outreach Client Training Tech Letter VBN|

Then you just add the "External:" expression to the beginning with the Table Transformer macro.

The problem is that we don't know where/how to break your original string coming from the Jira Issues macro (by special separators, string length, etc.). Physically it is a row of words with spaces. It is only logically that we understand that a correct variant is

|Client Outreach, Client Training, Tech Letter, VBN|

and not

|Client Outreach Client, Training Tech Letter, VBN|

or smth else.

So, as for now I don't have any ideas. Maybe smth can be done with the original field in Jira so that it will be better displayed in Confluence.

Laurie Huth April 8, 2022

The original field information from Jira (that has comma separators) is from a dropdown list. See images. 

The field as it appears in Jira:

Screenshot 2022-04-08 100405.png

after choosing options from a dropdown menu in Jira:

Screenshot 2022-04-08 130055.png

Jira automatically put commas into the External Document field shown above, as it knew where the separators were originally. Is there a way to have Confluence pull in the content exactly as it is shown in the field (with the commas). I've been trying to think of some clever workarounds...

Thanks!

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.
April 8, 2022

Unfortunately, I don't have any ideas. The Table Transformer macro won't be of any help because we can't put any splitting logic inside its query.

Maybe you should try to post another question with a different topic (smth regarding "Custom Jira field is poorly displayed in Confluence") and add Jira Issues macro to the hashtags - maybe this question will attract more experienced Jira users. I don't think that your case is unique, maybe there are some workarounds.

0 votes
Madison Small May 5, 2022

@Laurie Huth were you able to find a solution? I am running into the same issue :( 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events