How do I use Atlassian Connect to get Jira data and generate a JSON?

Asked

Viewed 553 times

4

I need to make a script to get some data from Jira and I believe that for that you have to use the API Atlassian Connect that uses a server in Node.js.

However, I don’t want to manipulate the data using the API but just get them and manipulate with another language.

So it is possible to use only the API and generate a JSON file with the obtained data? How?

  • 1

    In itself website has tutorials on how to use the api

1 answer

4


Atlassian Connect allows you to create extensions (integrations or plugins, depending on how you prefer to call) and is not necessary if you just want to make some requests for endpoints jira.

As already pointed out in comments, there is a overflowing documentation in the developers section.

The first thing to consider is what kind of service you’re dealing with, that is: Cloud (hosted by Atlassian) or Server (installed in your company).

Depending on what you want, the difference between such versions will be only the authentication method, but usually you can use basic HTTP authentication, only need to have or seek to obtain the necessary credentials.


For example, if you want to consult pending (issues) of a project, there is an API that allows you to run whichever query JQL via REST and get the result in JSON. Use any language for this.

In the case of jira.spring.io, I tested the following command to search all bugs to the project spr:

curl -X POST -H "Content-Type: application/json" --data \
    '{ "jql": "project = spr AND issuetype = \"bug\"","startAt": 0,"maxResults": 15,"fields": ["summary","status","issuetype"]}' \
    https://jira.spring.io/rest/api/2/search

The cool thing is that it works anonymously, without needing credentials, because it is a public project.

You can customize the search for your needs and also search others endpoints if you need other information.

  • 1

    I need to make a script that gets some information from this spring framework https://jira.spring.io/browse/spr/? selectedTab=com.atlassian.jira.jira-Projects-plugin:issues-panel like bugs and some other things for a search, just informed me of a possible api for this. if there is a simpler way to get the data for my script would be pleased to know

  • @Arcashaid See the updated response above

  • I just didn’t quite understand which api this talking about, the link leads to the middle of an Atlassian page with many other links, which the name of the api ?

  • @Arcashaid The API I’m talking about is the set of endpoints you can access. This is the Jira API. If you want a client library or command line interface that provides a client API to access the server API, that’s another story. Libraries exist, but require you to do some program. Command line tools I don’t know. REST endpoints are very easy to work in any language.

  • Language choice depends on the background of each, but due to the ease of handling JSON in Javascript, if you have nothing ready in another language, I would advise you to install the Node and implement a command line tool (no server needed) in Javascript to interact with Jira. But like I said, it could be in any language.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.