Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,411
Community Members
 
Community Events
184
Community Groups

How to get schedule data from Opsgenie into CSV format

Atlassian's advanced incident management platform, Opsgenie, enables you to ensure that you can respond to critical incidents in the shortest possible time. It empowers you to take action at any point in time. Through your monitoring systems and custom applications, Opsgenie receives alerts and ranks each of these based on their importance and when they occur.

In order to get an overview of your team's workload, it can be helpful to export the data contained in Opsgenie for appointments. CSV is a practical format for export, as it can be used opened by a broad range of applications.

In this article we will show you how to export appointment data from Opsgenie in CSV format. We will use a practical use case by one of our consulting customers as an example. You can thereby adapt this example to your situation and solve your own personal use case.

 

Through our practical example to your data overview from Opsgenie

We recommend using Postman for the HTTP requests. We will also use Postman for this tutorial.

In order to eventually have a user-friendly and readable export of who worked and when. We first need to understand how many schedules there are in our Opsgenie. For this, Atlassian provides an GET Schedule API:

The result of this query should be a list of the available schedules in your instance, and, most importantly, the relevant Schedule ID.

When performing the GET for our client, Postman has shown the status 200 OK. So the GET was successful. In our example, the client used more than one schedule.

Now, a copy of the data can be made in JSON by using the copy tool (see bottom right of the screenshot below).

The data can then be inserted into a JSON renderer to get a descriptive overview of the data (for example, the following JSON renderer can be used for this: http://json2table.com/#). After the data has been inserted there, the names of the individual schedules and their IDs can now be seen. In our customer example, the following view was generated:

Now, we know the ID for the schedule, we can amend the next API in order to retrieve a query with the schedule information.

<https://api.opsgenie.com/v2/schedules/:identifier/timeline>

To retrieve the timeline for a schedule, the identifier retrieved from the timeline GET must be inserted. In the case of our client, we retrieved the timeline for the IT Operations schedule with this GET:

https://api.opsgenie.com/v2/schedules/70a07640-02a9-4d4a-8935-8384b839f331/timeline/

With the same authorisation in the headers, we have again obtained a status of 200 OK. If your status is also OK, you can go ahead and copy the data generated by the GET again and paste it into a JSON renderer to get a descriptive view of the data again.

After the data has been inserted into JSON renderer, the schedule for a week can be viewed. In the case of our client, the overview generated in the process looked like this:

Alternatively, the JSON data can be entered directly into a tool that converts it into a CSV file. This allows the data to be downloaded and displayed directly in Excel.

If you want to get a whole month of data at once, you have to change the timeline GET by appending an IntervalUnit as follows:

https://api.opsgenie.com/v2/schedules/70a07640-02a9-4d4a-8935-8384b839f331/timeline?intervalUnit=months&date=2021-08-22T22:00:00Z

The modified timeline GET must then be entered into Opsgenie as before:

In the example, we again got a status of 200, so we could copy this data in JSON format and paste it directly into the renderer. By entering this, the renderer creates a CSV file like the following:

Follow the steps described, and you too will be able to export appointment data from Opsgenie in CSV format. 

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events