Hi All,
I am executing a groovy script file in the workflow post-function.
In the system info. of JIRA i can see - Dcatalina.base=/usr/share/JIRA thus I gave the relative path for the file as groovy/statusUpdate.groovy it didn't work while giving the full qualified path i.e. /usr/share/JIRA/groovy/statusUpdate.groovy works well.
What may be going wrong?
JIRA 5.2.11
Script runner 2.1.15
Thanks.
So I don't know why it's using / as working directory. The script paths are resolved relative to the working directory, which is normally but not always catalina.base.
Not sure I would worry too much because this changes in Script Runner 3.0.
> is there a way to specify an env. variable in the script path i.e. ${jira_home}/groovy/myscript.groovy or ${catalina_base}/groovy/myscript.groovy ?
No, in SR 3 you specify one or more scripts directories, and <jira_home>/scripts is automatically a scripts dir. Paths are resolved relative to your scripts dirs.
Hi Jamie Echlin , thanks for your answer, I think we would need to upgrade to SR 3.0 sooner to latet, just a small query , when using the issue clone functionality in the post function of a transition such that the new issue is create in a new project. In this case is the event "issuce created" for the new project fired?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin [Adaptavist] , is there a way to specify an env. variable in the script path i.e. ${jira_home}/groovy/myscript.groovy or ${catalina_base}/groovy/myscript.groovy ? @Michal - In my case - user.fir gives the path of the root dir and only the fully qualified path is working and not the relative path.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For one or another reason we also used the full path in JIRA 5.2.x but can't remember why.. Check where your jira-home directory is (JIRA system configuration panel). When checking our system for the property user.dir we get the path to the bin directory of our running jira installation. For some reason the scripts should be placed in the jira-home/scripts directory, but as I said don't remember why. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin [Adaptavist] , I executed the code - System.getPoperty("user.dir") in the script console and I get the root as the result i.e. "/"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yeah but it should... that was all I could think of at the time. Run this in script console and let us know what it reports: System.getProperty("user.dir")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin [Adaptavist] , but it's not working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA 5.2.11 Script runner 2.1.15
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, could you give more details about the software versions you are using (jira, script runner)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.