Hi,
We are running a development version of JIRA in a remote server and I am trying to debug from my workstation.
In the documentation it says
Put a breakpoint on the last line. Copy the script path and run the script in the groovy admin panel. The breakpoint will be hit.
But I am not sure about how I can point Script Runner to the path of my script, assuming that's what is required.
Is it possible to debug on a remote server at all?
The IDE knows what file to open when the breakpoint is hit from the name of the class, and presumably some debug info added to the class at compile time.
However in the current version of script runner (this will change in the next major release), for scripts, you will need to wrap it in a class.
Eg:
class Foo() {
def main() {...}
}
new Foo().main()
this is a bit of a pain.
I don't think there is any difference whether you are debugging remotely or locally.
Thanks for your response Jamie.
I already have my script wrapped in a class in the same way as in your example.
However when you say
Copy the script path and run the script in the groovy admin panel.
Is the "groovy admin panel" the same as Script Runner in the Jira Addon's page? I am a bit confused with the terminology here.
If it makes any difference, my script will eventually run as a service.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I strongly advise you to run jira on your own machine, and not worry about remote debugging. If you need a copy of your production database to test then get one...
When you are finished you can deploy to production.
If you later have problems then clone the env to your dev machine. If you remote debug it will suspend the jvm when it hits a breakpoint, and freeze jira for anyone using it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perfect! It now makes complete sense.
I am trying to setup jira to start with JPDA on windows which I didn't have much luck so far, but I will get there.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, it's the same. The plugin was renamed to script runner some time back.
Running the script as a file from Admin -> Script Console is a good way to test and develop the service.
The file has to be local to the jira server - you can't point it at a file on your machine. Scp it to the machine and edit it in winscp or something...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problem... ask if you have any questions on debugging. There is some basic info here: https://jamieechlin.atlassian.net/wiki/display/GRV/Script+Runner;jsessionid=BFE83D471B6DB72BDE06F5E31B22663D#ScriptRunner-DebuggingandCodingwithIDEA- the pictures are years out of date but the principal is the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to confirm, it's all working nicely locally. I had to change the port from 8000 to 8001 as it was in use by something else.
In addition it appeared that breakpoints only worked inside the class and not in the code instantiating and executing the object's methods.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, in this version of the plugin breakpoints in scripts don't work, but they do in your own classes or classes you define in scripts.
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.