Can we utilize python for scripting or automation in Jira?

Shib Saha September 30, 2021

Hi Everyone,

In our Jira admin team we want to on-board a Python developer for some other project but we want to him work in Jira team as well for scripting and automation part.

My question is "can we use python as an scripting language for automation or data flow in jira"?? if yes we can utilize the same resource for both purpose.

Please let us know if anyone is already using python for scripting in jira or know how to do it.

Please also let us know what should be the setup for using python as scripting language in Jira like any additional add-on for jira is required or can be done with jira only.

Thanks a lot in advance.

Regards,
Shib

5 answers

1 accepted

4 votes
Answer accepted
Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 30, 2021

You can use the Jira REST API from most any language, including python.

The built-in Jira Automation, however, doesn't support embedded scripting.

2 votes
Erin Quick-Laughlin September 30, 2021

Hi Shib,

I don't know if this is the only answer, but you could use Python if you ran it as a web service, and use the Jira Automation component Send web request in your flow.  The response is available as part of the {{webResponse}} specifically {{webResponse.body}}.  

Specifics are here:  https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828 

Erin

Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 30, 2021

Good point, @Erin Quick-Laughlin. Jira Automation can send web requests outbound. So this approach can be used for "data flow" from Jira to a custom web service.

But this functionality doesn't support the "use [of] python as [a] scripting language for automation" as noted in the original post. Maybe it helps with part of what @Shib Saha is trying to do, though!

Like Bill Sheboy likes this
1 vote
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 1, 2021

There's a few Python REST API wrapper packages, but I can't vouch for how well they work.

This one is only for Jira, and looks well-maintained:

https://github.com/pycontribs/jira/

This one covers multiple Atlassian products, but I'm not sure if it's as well-maintained:

https://github.com/atlassian-api/atlassian-python-api

If you're more of a DIY person, here's some examples that include all the hairy details about auth, etc:

https://www.opentechguides.com/how-to/article/python/185/jira-python-rest.html

0 votes
Prasad Prabhu June 29, 2022

Hi @Shib Saha 

Can you explain what your use is a little more? Are you trying to invoke Jira APIs from inside a python script? If so, the answers above are good pointers to get started.

If you are trying to have a shell or python script invoked as an automation script I don't think this exists at the moment. I am building a Jira app that will allow this to happen. If you are interested, please let me know. I'd be happy to help!

Happy automating!

0 votes
Sedera Randria
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2021

Hi @Shib Saha 

For several year now, we use Python scripts + Jira REST API to automatically create tasks when onboarding new people. Then, Jira Automation updates tickets with additional details. Great combination.

Excel/VBA would have been more relevant to simply push a table into Jira, but I guess we are using Python for the same reason as you :-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events