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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Community Members
Community Events
Community Groups

Xporter - Parse multiline field


I'm trying to parse multiline field data from an x-ray test, but with no success. Data column is filled with following pattern for one test step :




I tried to use split / exec / match on the content of the data field with endline separator, but I didn't manage to loop over array in order to retrieve details separatly.

#{for i=JQLIssuesCount|clause= issuetype = Test AND key = EVAL-218 }

#{for r=JQLIssues[i].TestStepsCount}

${set(tab, %{‘${escape:JQLIssues[i].TestSteps[r].Data}’.match(/[^\r\n]+/g)})}

// What is the relevant way to loop over ${tab} ?



Is there a way to loop over a split array and display content individually ?


1 answer

Hi @Tomy 

I haven't fully understood what you want to do, however here are some insights that might help.

First, in Xporter, the Javascript code is run embedded under the %{....}, and it does not affect other Javascript code. When there is a %{....} is like calling a subroutine that returns an output.

However it is still possible to make some interesting code, like the one below:

${set(tab, %{var final=""; var steps='${escape:JQLIssues[i].TestSteps[r].Data}'.split('\n'); for (var x=0; i < steps.length; x++) final=final.concat('\t', steps[x]); final})}

In this Javascript it splits the information of Data into an array, then it iterates over the array to build a string of values separeted by tabs, and it returns this output string. Please note that the output must be a simple datatype, like a string or a number.

After, you can add another Javascript line to process the Xporter variable ${tab}. However, and again, it would be processed in a subroutine approach, so it is not possible to iterate over the variable ${tab} like you do for the TestSteps (or other Xray information).

I hope this helps.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events