How to run an external process in post-function using script runner

Maria Maria September 29, 2014

JIRA (3.13.3 - Windows Platform)

Hi,

We would like to run an executable with parameters in a  post-function, we've tried several ways, one as follows, with "WaitFor()" the workflow transitions takes a long time to complete, without "waitFor()" the workflow transition complete faster, in neither case the command run successfully.

We've tested the command.text out of JIRA, in command line, and it works well.

{code}

def command = """C:\\JIRA-Enterprise-3.13.1\\datadir\\groovyscripts\\InsertPBI.exe "http://url" "web" "$title1" "$descrip1" "$myIssue.key" "$myIssue.assignee" """ //string
 log.debug command.toString()
 Process process = command.execute()
 process.waitFor()

{code}

Is it possible to do what we are trying to accomplish?

We are very grateful for script runner, it has helped us a lot, we were able to automatize many tasks with it. It's a great tool.

Thank you!

 

 

1 answer

1 accepted

0 votes
Answer accepted
Maria Maria September 30, 2014

Hi,

We could solve the issue, it was something related to authentication in the external procedure, now is working perfectly.

Thank you for this great plugin!

Regards

Sohail Khurshid April 11, 2021

Hi Maria,

I'm having the same issue while trying to run an external program in a post-function using script runner (code is almost similar to yours). The external program is supposed to return a string value that will be used further in the post-function script. The program runs perfectly in groovy console (returns the expected output). However, the same program does not produce any output when run from the post-function. I even tried capturing the process output (consumeProcessOutput) but no luck!

It would be great if you can advise on how did you fix your issue.

Thanks,

Suggest an answer

Log in or Sign up to answer