Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to print something on the script-runer console

Umair Haroon
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, 2014

Hi, Im using the groovy script runner .

I would like to print out some stuff (strings etc) on the console provided by the script runner plugin.

I tried print, println , both dont work.

The only way I can get some output from the console is to return the variable I want printed , eg return "hello world"

How I can print something without using return?

Thanks

2 answers

1 vote
Andreas Ebert
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, 2014

I don't think you can print arbitrary output to the script runner screen. Instead, you can either:

  • collect all output and at the end return it as a String
  • if you have access to the file-system: log or print all output, as you normally would, and open the application's log-file to see the output
0 votes
JamieA
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, 2014

As Andreas said. It's not really intended to writing reports, but you can return a StringBuilder / StringBuffer, that contains html.

I find logging the best approach though for the type of scripts I run... which is usually maintenance and housekeeping or exploratory stuff for testing.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events