Format text strings

Ari Raatikainen
Contributor
July 24, 2024

Hi,

I use the following smart value:

{{#lookupObjects}}{{index}}. {{Key}} {{Name}} {{"Application Type"}} {{/}}

to store results of LookupObjects into variable businessAppResults

When accessing the variable in other actions by using {{businessAppResults}} the printed output (e.g. in email body) will result:

0. CMDB-XXXX Azure DevOps Server On-Premise 1. CMDB-YYYYY FRENDS On-Premise 2. CMDB-ZZZZZ Silk On-Premise 3. CMDB-XYXYX XpressFeed On-Premise

 

 

Is there a way to modify above smart value so that the output values were Comma-Separated and each record is separated by newline char? Or can I manipulate the result value {{businessAppResults}} with some functions?

The desired output would be like this:

 

0. CMDB-XXXX,Azure DevOps Server,On-Premise
1. CMDB-YYYYY,FRENDS,On-Premise
2. CMDB-ZZZZZ,Silk,On-Premise
3. CMDB-XYXYX,XpressFeed,On-Premise

All ideas are welcome !

2 answers

2 accepted

2 votes
Answer accepted
Kevin Patterson
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.
July 24, 2024

I'm not sure <br> is supported as a line break in all of the jira output actions. speaking from another use case I've had where a client wanted to output the results to a comment on the issue we used \\ to create the line break between objects. 

if you are trying to add this to a comment on the issue  adjust Ari's syntax by removing the <br> and replacing with \\ for the comment on issue action

 
{{#lookupObjects}}{{#=}}{{index}}+1{{/}}. {{Key}},{{Name}},{{"Application Type"}} \\ {{/}} 

 

Ari Raatikainen
Contributor
July 24, 2024

Thanks Kevin, <br> works when output is part of Send mail component and HTML is selected as sending format, \\ doesn't work in this use case of mine.  

2 votes
Answer accepted
Ari Raatikainen
Contributor
July 24, 2024

I figured this out.. adding commas and <br> does the trick. Working solution for reference.

{{#lookupObjects}}{{#=}}{{index}}+1{{/}}. {{Key}},{{Name}},{{"Application Type"}}<br>{{/}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events