Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Format text strings

Ari Raatikainen
Contributor
July 24, 2024 edited

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 edited

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
atlassian, atlassian community, journeys for jira service management, journeys for jsm, eap jsm atlassian, early access program atlassian, early access program journeys atlassian, early access program journeys jira service management, join atlassian eap

Join the Early Access Program (EAP) - Journeys for Jira Service Management 🚪

Journeys is a brand new feature in Jira Service Management that helps you streamline various processes in your organization that may cross multiple departments, such as employee onboarding or off-boarding that require action from different teams. ✨

Join the EAP →
AUG Leaders

Upcoming Jira Service Management Events