How to export Opsgenie users with configuration

William Butt
Contributor
April 18, 2022

Hello,

Is there a way to export a list of Opsgenie users along with configuration around notifications (type of notifications and phone numbers)?

Thank you.

William

1 answer

1 accepted

1 vote
Answer accepted
John M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 18, 2022

Hi William,

There is no report in-app for that, but the Get User API will list the user contact number and method for individual users. 

You could use the List User API first to get all user IDs (which are needed for the Get User API) and then have the Get User API loop through them to list all users and their contact number/methods. 

William Butt
Contributor
April 20, 2022

I was looking more for an automated way rather than through the API... I'm not a coder or know how to execute these commands... was hoping there would be a report that could be run. There should be a simpler way to do this.

Thanks for the information though. 

Like # people like this
Jim Hawkins
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 19, 2022

Same situation for me, trying to run a report of unverified users but am not a coder. It seems there would be a way to get a simple list without wading into the "high grass".

Diana Shorafa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2024

It doesn't seem like the Get User API call returns phone numbers.

Has anyone figured out a way to retrieve that piece of information a way or another?

William Butt
Contributor
January 19, 2024

Hey Diana,

 

 I figured this out by if you use https://docs.opsgenie.com/docs/contact-api you can get the configured numbers.


Opsgenie Contact API.jpg


 

Hope that helps

 

Like Diana Shorafa likes this
Guilherme Nicolosi September 27, 2024

Hi folks, William suggestion works for getting info at the individual level. Does anyone knows how to get that info in bulk for all my user base? Thank you!

William Butt
Contributor
September 27, 2024

Hey Guilherme,

I just set up a power automate flow to get this information.

1. Get the List of All Users by using the List Users API to get a list of all users. Use the 'GET https://api.opsgenie.com/v2/users' endpoint.
2. Then loop Through Each User: For each user, use the 'GET /v2/users/:userIdentifier/contacts' endpoint from the Contact API to get the contacts for that specific user.

- You will need to use the 'Parse JSON' actions for both to get the raw output.
- Once you get the output, you will then need to have an array variable to compile a list of the information.
- Once the array is compled after the 'apply' actions, you can then add a compose action to return the information you need.

Example I did was using an expression for this... 'concat(item()?['method'], ', ', item()?['to'], '<br />')'

Attached is a screenshot of the actions I used and how the information was presented... I just sent it to my email. You could also send it to an excel file.

Get Opsgenie Contact Information.jpg 

Hope this helps

Like John M likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events