Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

execute python script from custom dialog box using scriptrunner

Hi all,

I have a custom dialog box I created using a scriptrunner web fragment and custom REST endpoint.

On this dialog box I have a button that I would like to fire off a python script that lives on the jira server.  I'm not really sure how I could go about doing this.

My initial thought was have the button point to another custom REST endpoint where the the script would be executed. Is this at all possible?

I'm open to feedback and new ideas on how I can go about doing this.

Thank you

1 answer

Hi @Omar Morales

You could try something like this:-


def file = new File('/home/ram/Downloads/')

def command = "python3 ${file.absoluteFile}"

def proc = command.execute()


log.warn "return code: ${ proc.exitValue()}"

log.warn "stderr: ${proc.err.text}"

log.warn "stdout: ${}"

def fileReader = new FileReader("/home/ram/Downloads/readme.txt")

fileReader.readLines().each {

log.warn it


I have tested this to execute a very basic python code, i.e. to update a text file using the ScriptRunner console, and it is working.

Below is a screenshot of the configuration and output for your reference:-


You should be able to use a similar approach on the web-fragment.

I hope this helps to answer your question. :)

Thank you and Kind regards,


Hi @Omar Morales

Does the solution I provided help to solve your question?

If yes, please accept the answer.

Thank you and Kind regards,


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events