The bluntest way to do it is System.out.println("your text") but see https://www.adaptavist.com/doco/display/SFJ/Set+logging+to+help+debug+your+scripts for a better way to do it
I guess my question should be to you is: can I print out stuff in the service endpoint script? I was unable to print it from the methods listed here:
https://scriptrunner.adaptavist.com/4.3.3/jira/rest-endpoints.html
I put it in the GET method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then it's not executing the log line for some reason. Is the script failing or exiting before it gets to the log line?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Nic,
I'm not in front of my work computer right now. I just got started working with Scriptrunner last week and this had puzzled, but I do recall the script saying success and printing a JSON when I called the method. I had the print statement before the return statement, so if the return statement executed, then I figured the print statement should have as well.
Here is an image:
Just image me System.out.println("Test") right before the return statement.
And that I called
<jira_base_url>/rest/scriptrunner/latest/custom/doSomething
on a button click. That basically what I did, got a success for run, but no log message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I'm a bit stuck, because I get "Test" dumped into the application log when I use that code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yikes, I'm away from my work computer but application log you're looking at? I put this code in the service endpoint script and did a GET request to make it fire and when I look at the logs, I didn't see anything. Can you please provide me with a screenshot? Maybe I'm looking at the wrong spot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.