I want to executing a shell script in the post functions and the output obtained from it should be stored in a Text Type custom field.
I have tried using the below script but it did not work. Kindly suggest.
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = 'sh /jira/test.sh'.execute ()
proc.consumeProcessOutput(sout,serr)
String fileContents = new File('jira/out.txt').getText('UTF-8')
return fileContents
Hi,
I have been using this snippet to execute sh scripts :
def shCommand = "sh /jira/test.sh"
return = Runtime.getRuntime().exec(shCommand);
int exitCode = return.waitFor()
Let me know how that went.
Antoine
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.