Why to use Python on Jira?
As per Coursera
Python is a computer programming language often used to build websites and software, automate tasks, and conduct data analysis. Python is a general-purpose language, meaning it can be used to create a variety of different programs and isn't specialized for any specific problems.
I’ve worked with a few programming languages so far, they clearly vary in complexion and levels of stress that you have on your learning curve, but surely the language that’s quicker to learn, and the more useful in general use cases, is Python.
It is used in all the industries including Space Exploration
Python is SpaceX’s most used programming language
Python is the most popular programming language because of its built-in libraries and beginner-friendliness. It is used by SpaceX to write the code, construct the spaceship, and then launch it into orbit. They employ a wide range of internal tools, from the most fundamental ones like NumPy and matplotlib commands to more advanced ones like the Python-based framework Django. - source
I don’t really need to oversell this, it sells itself when you check code complexity. Let’s start with the easiest comparative: the Hello World comparison in languages.
C
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
Java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Assembly
; ld -m elf_i386 -s -o hello hello.o
section .text align=0
global _start
message db 'Hello, World!', 0x0a
len equ $ - msg
_start:
mov eax, 4 ;
mov ebx, 1 ;
mov ecx, message;
mov edx, len ;
int 0x80
mov eax, 1
int 0x8
and ….
Python
print("Hello, World!")
I feel like this post could end just with the comparative, but let's keep going.
Some context on languages
I’m not here to demonize other languages, they all have their respective usages and Python is built on C, so under the hood that’s the engine, and as Python, all the languages have pros and cons.
I always like to show the comparative when talking about differences in programming languages because this is really a visual thing, and you have the deep understanding that less code is faster to write and easier to memorize and understand, and in this case, way more readable and direct, something that the other languages fail in a few different ways.
Using Python on Jira
Easy for Jira is a scripting extension for Jira Cloud that relies on Python for its engine, allowing you to automate, integrate, treat, use AI, etc. on your Workflows or event based, via Listeners.
Easy for Jira uses python because python is easy to learn, has a very safe learning curve compared to other languages such as C and Java or Groovy (where the shoe stands).
Personal Experience using coding apps
I’ve been working with Scriptrunner (the shoe app) for little more than 3 years now, and even having lots of experience with it, It’s always the same flow, the amount of time wasted developing in it is really too much to bear, I cannot say a word about reliability though, Scriptrunner is German technology, you can never say anything about way they design anything because it is reliable, cars, houses, everything, it is made to last and it’s surely reliable. Problem is the counter part of that reliability, we have to get their docs (even after 3 years, because their functions to make API requests are too big), or get some pre-packed code I use in all my implementations to simplify development and scale that.
As I am a developer, while using Scriptrunner I saw a lot of room for improvement, as I created the main pillars of all my scripts as a framework to develop on the app, with some ready to use functions to simplify their complications, this action made coding solutions easier.
Some of what I saw coding in Scriptrunner for 3+ years:
Hard for newcomers, steep learning curve
You take a lot of time to get some familiarity with the app, as it’s engine is in Groovy (java) and for newcomers this is really a challenge. I’ve known at least 7 individuals that gave up on learning Scriptrunner due to the high complexity allied to their little understanding of Java, they knew programming, but could not bear working with Groovy. All the code you do is like 100+ lines of code if you want something minimally complex. Coding should not be that hard.Integrations are up to you
If you want to have any sort of integration running, you need to code it yourself, from scratch, no help at all, they do have some coding examples, but nothing really usable for integrations.Simple things made overly complicated
Editing a single issue takes 6 lines of code with NO logic, if you add logic go to 20 lines of code, this just does not make sense as it can be direct, as it is in Easy for Jira.Time. The over complication makes it time consuming
From the stakeholder request for a new feature, to it’s implementation, testing and deployment, considering a lot of factors but the main one the feature complexity, it can take from 5 days to up to 2 weeks, depending of course in a lot of factors. So let’s put this to numbers:
If a consultant or admin takes 10 hours developing a solution, with an hourly rate of 65 USD, it costs to the company $650 to develop.
Our main goal in Easy for Jira is to reduce Lead Time so the same thing you do in 10 hours in Scriptrunner, you can easily achieve in less than one hour in our app, due to the Context Variables such as the Issue object, that facilitate your assess to Issue data.Lack of reusability around the code you create
If you want your code to run as a post function in different workflows and transitions, good luck and get ready for hours of boredom, because if you need your function running on lets say 50 transitions, it’s at least 450 mouse clicks to create that. Now you want to make a change, well, good luck again editing all the code you created, because you need to edit each one of them, to avoid that we created the Code Repository where you can code once, save your code, import it around your instance and edit it in a single place.
I can be pointing all the flaws of my competitor all day, but this is not what I’m trying to do here. All the pointed items were used as founding stones on the design of Easy for Jira. I can’t say our app is perfect, it’s not, there’s a lot of features to be implemented and enhancements ahead of us so it becomes a very good app, but so far I can say as a daily user that EFJ is a fair competitor for sure.
To back that, I will outline some use cases, that is the most used functionality, editing issues and working with related issues, a comparison between the 2 apps.
This is the Scriptrunner code to edit one Issue
def response = put("/rest/api/2/issue/${issuekey}")
.header('Content-Type', 'application/json')
.body([
summary: "My Example Summary"
]).asString()
// this is to log the request, if it was successful, because sometimes it can fail
assert response.status == 204
This is the Easy for Jira Equivalent
issue.set("summary", "My Example Summary")
Now let’s consider I want to search for issues using JQL with Scriptrunner.
def issues = []
def startAt = 0
while (true) {
def result = get('/rest/api/2/search')
.queryString('jql', jql)
.queryString('startAt', startAt)
.queryString('maxResults', 100)
.asObject(Map).body
issues.addAll(result.issues)
if (issues.size == result.total) {
break
}
else {
startAt += 100
}
}
And the Easy for Jira Equivalent is →
issues = api.search_issues("your query here")
Really wanted to have a comment about this, but to summarize, the excess of code, makes it harder to maintain, harder to read, and too intimidating, but you can take your own conclusions.
Conclusion
Using Python on your Jira instance via Easy for Jira will save you a lot of time due to the development of the app being made around our North Star, the reduction of the lead time for consulting and Jira admins. Our sole focus is to be able to deliver with Easy for Jira, any functionality in less than 50 lines of code and in less than 8 hours (even for more bad ass implementations).
Our app is considerably cheaper than our biggest competitor, at least 68x times faster and code complexity is less than 1% as our code is really readable and any person that can read can understand and also program on it. To help with that we’ve developed the Zero to Hero Guide.
We are continually adding more integrations and features to enhance even more the possibilities for our users. Our long term goal is to become the Industry Standard for coded automation so you can be sure the development will be based on user input, we want to make the better product around, with no room for competition.
Hope you liked the post, if so, spread the word, we want early adopters and we will support you in your brief learning journey, I see one can easily master the app in less than a week by following the Zero to Hero guide, so good luck and goodbye!
Best,
Nivaldo Georg Junior
Product Owner in Easy for Jira
Easy for Jira - Python Automations, 2023