Missed Team ’24? Catch up on announcements here.

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

Python scripts to work for JIRA

gayatrii April 20, 2016

Hi,

 

In JIRA at present for some validations, I wrote some JavaScripts under custom fields. But now I have a requirement that I need to replace all of them with python scripts. But I'm new to python. How can I connect to JIRA  through python ? How to run Python scripts from JIRA? 

 

Thanks in advance,

Saiibabu

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
J.Fawkes April 20, 2016

Hi,

I solved the problem by using the Add-on Script runner in Jira. There I created a scripted field in Groovy and called the command prompt and run the python script from there. Here is a simple example of the script

def process = ['cmd', '/c', 'filepathToPython.exe', 'filepathToPythonFile.py'].execute()
process.waitfor()
return p.text
process?.err?.text can be used instead of process.text if one want to see eventual error messages.

gayatrii April 20, 2016

is there no need to install python on prod server? i want to write a one python file like mypythonfile.py . where i need to place the file? How the file will run? 

Like Alexis Evans likes this
J.Fawkes April 20, 2016

You may also try Jira Scripting Suite.
https://marketplace.atlassian.com/plugins/com.quisapps.jira.jss/server/overview
It allows you to execute custom Jython script to evaluate workflow conditions, perform validations and post functions. Script is evaluated in the context, which differs for each type of script (see sections below for details).Jython is a Python port to Java. Also go through http://quisapps.com/confluence/display/JSS/Scripting+Samples for some example scripts.

TAGS
AUG Leaders

Atlassian Community Events