Pascal Robert
3 min readApr 9, 2020

--

How to extend JIRA by APIs and services

Jira is a powerful tool to manage issues, tasks and software projects. With the add-ons that you can download from the Atlassian Marketplace, it’s even more powerful.

But did you know that Jira also has pretty good APIs? If you need to manage data in and out and add-ons can’t do it, or if the add-ons cost too much for your needs, you still have options! Let’s look at those.

First, it is really important to say that Jira Cloud and Jira Server are quite different in the APIs area. Jira Cloud is a managed service, and it has more limitations than Jira Server.

Let’s check the differences between the distributions.

Jira Cloud has:

  • A REST API, which allows to modify many parts of Jira, including adding/modifying/deleting issues, configuring projects.
  • Webhooks, which you can use to send a JSON payload to another system. The hooks will trigger on selected events that you decide. For example, you could send the payload to another Web service only when a new comment is added to an issue on a specific project. You can also trigger a hook inside a workflow transition.
  • Issue collectors. This will build a form that you can include in any Web site to create tickets in your Jira instance. Ok, so it’s not an API, but it is an overlooked feature of Jira.
  • Web request in Automation. In Automation, you can add an action to send a request to a Web service, akin to Webhooks. The difference is that the payload can be either the issue data, like the Webhook payload, or any custom data, and it can be any HTTP verb (PUT, GET, DELETE, etc.), while a hook only does a POST with the issue data.
  • Apps (add-ons). You can build your own app with the Atlassian Connect framework. But be aware that apps in Jira Cloud are way less powerful than in Server. For example, you can only store very small amount of data in your Jira Cloud instance, you can’t build servlets, and many more other limitations. All large apps in Cloud have only hooks in the UI, and everything else is hosted on external services that the app developers manage.

What about Jira Server? Well, it can do a lot more than Cloud for integration. You have the REST API, you have Webhooks, Automation, issue collectors and apps. But you also have:

  • Listeners. Those are a bit like Webhooks, but you have total control of the (Java) code, so you can use SOAP (!!) or any other transport/protocol/whatever instead of sending a JSON payload to other systems.
  • Services. Want to run a cleanup task every month? Archive a project at a certain schedule? Use services for that. Write a Java class that does that you need, specify a schedule and it will run.

And apps in Jira Server almost has no limits. It can even have its own database tables stored in the same database as Jira. An app can be very simple, an example is an app that adds a menu in the global Jira menu, and this kind of app only requires two XML files in a Maven project created with the Atlassian SDK.

As you can see, you have many options, and good chance that you will find a way to extend your Jira instance to your liking.

… but if you want even more power and save development time, ScriptRunner is your friend. We will look at it in a future post.

--

--

Pascal Robert

Project management, consulting, Web development, databases, system administrator, business analyst, I have done it all.