Hi All,
Please let me know is it possbile to run a script on server as a part of JIRA workflow transistion?
Means, if an issue trasistion happens then a script has to run on server. Somehow is this possible in JIRA? Any third party plugin has this feature?
Please suggest.
Kindly let me know if my query is not clear.
Many thanks in advance.
Sanu P Soman
Community moderators have prevented the ability to post new answers.
The simplest way is just to use "ssh otherserver cmd"
Set up your private keys so there are no authentication prompts.
In script runner, the groovy script is simply:
"ssh otherserver cmd".execute()
I'm very much new to programmic world. Could you please provide some more details on ths.
Do you mean I need to add following line, "ssh otherserver cmd".execute() to the groovy script? If you don't mind, could you please provide one example to run shell script (script.sh) on a server (server1.domain.com) as part of workflow tansistion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm very much new to groovy script. Could you please provide some more details on ths.
Do you mean I need to add following line, "ssh otherserver cmd".execute() to the groovy script? If you don't mind, could you please provide one example to run shell script (script.sh) on a server (server1.domain.com) as part of workflow tansistion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope, the above is a complete example. You put that in a file called something.groovy, and then in the post-function, choose "script function", and enter the path to that file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"cmd" in my example is the path to a shell script or other executable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So then the groovy script content will be,
---------------------------------------------------------------------
"ssh server1.domain.com /location/script.sh".execute()
----------------------------------------------------------------------
??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes... maybe "ssh user@server" but I presume you will work that out. That's not a jira related issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many thanks Jamie... it works:)
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.
you can add postfunctions to transitions.
Imagine postfunctions as a TODO list of things that must happen when a transition is invoked. There are a couple of predefined postfunctions in jira such as change issue status, reassign etc... Maybe there is something that covers your needs?
If not, you have two options.
1. Use Scriptrunner Plugin as mentined above. This enables you to create new postfunctions and apply groovy scripts to them.
2. Make your own plugin and introduce your own new postfunction.
check this
http://www.j-tricks.com/1/post/2010/08/workflow-post-function.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the Scriptrunner Plugin. There you create own scripts for postfunction or use already existing ones.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok.. any idea with this how I can run a script (simple shell script to check a specific file on a dirextory ) on server (Not in JIRA server)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if that was possible, jira plugins would be able to steal any file from your server.
What are you trying to do actualy? if you just want to read some file, you must have it declared as resource.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I want to run a shell script on another server as part of issue workflow transistion.
Means, suppose an issue closing then a shell script has to run on a server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the other server must somehow expose this feature to your jira server.
lets say your Jira Server invokes a workflow transition and triggers a postfunction. This postfunction calls the other server and invokes a service which can start a shell script.
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.