Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Use scriptrunner to call python script on Jira Server. Edited

I am integrating Jira with another system and want to call a local python script during a close transition on an Jira issue.

How can I invoke the local script using scriptrunner?  The python script is in a local directory on my Jira server. 

Additionally, I'd like to be able to pass an argument(close reason) to the python script, if possible.  Can I do that with scriptrunner? 

1 answer

0 votes

A very blunt approach (which will try to run anything you want)

def thingToRun = "Command (including parameters) to run".execute()

thingToRun.waitForOrKill(x)

x being the number of milliseconds to let it run before killing it as a suspected zombie (I think it's milliseconds, been a while since I used it)

Then you can interrogate thingToRun.exitValue() to see what the return code was.

Thanks Nic

 

I can't get this to work at all.... I was wondering if you could help.  I can put the absolute path location on the linux server where Jira server is hosted and it can't find file/folder.  I've also tried to add the file to the JIRA_Home/scripts directory with same result... (and several other areas).

 

So, I would like to pull the offenseID and a custom_field(closing reason) and pass that to the script.

Ben Poulson Community Leader Oct 22, 2019

Could you try running an "ls /absolute/path/to/script" for the directory the script is stored in, and returning the exit value?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,664 views 22 33
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you