Josefine
Josefine

Reputation: 181

Call python script from Jira while creating an issue

Let say I'm creating an issue in Jira and write the summary and the description. Is it possible to call a python script after these are written that sets the value for another field, depending on the values of the summary and the description?

I know how to create an issue and change fields from a python script using the jira-python module. But I have not find a solution for using a python script while editing/creating the issue manually in Jira. Does anyone have an idea of how I manage that?

Upvotes: 1

Views: 1773

Answers (2)

Josefine
Josefine

Reputation: 181

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.

Upvotes: 2

mdoar
mdoar

Reputation: 6891

Take a look at JIRA webhooks calling a small python based web server?

Upvotes: 1

Related Questions