You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I am looking to make the IT rota public, hence looking to integrate the rota with share point which can be made public inside the org. Has someone done this, and can you please share how you did it ?
I have done this, but it took a good deal of perl scripting.
I would basically use API calls to OpsGenie to get the oncall users. Examples of API endpoints that i used..
Get on call user : schedules/$rotation/on-calls?scheduleIdentifierType=name
get next on call user: schedules/$rotation/next-on-calls?scheduleIdentifierType=name
get all users in rotation: schedules/$rotation?identifierType=name
I would generate the ordered on call list
Then I would use Sharepoint's API to update that list to a list in sharepoint. Using things like the "lists/GetByTitle" endpoint, and building the structure that sharepoint wants.
I'll be honest here, it took a lot of debugging and really delving into the details of how both the Opsgenie REST API and the Sharepoint REST API worked. I wrote a few perl libraries to handle a lot of the details to get some re-usability out of it.
But it is possible to look up the on call users and rotation, and post that to a sharepoint list for users to see.
Another option you may want to look at is to leverage the ical support in OpsGenie
that might be good enough for what you want to do.
ical support in OG is the best option for SharePoint, however, in my organisation, we have limited access to SharePoint features, and could not leverage on the ical data extracted from OG :(
Sharepoint offers a great Power Automate feature, where you can create a custom flow, which can be made to get executed daily at a certain time.
No Perl scripting as such is required, as power automate provides a visual designer to create such an automation task.
A general knowledge of how to create SharePoint lists, and render them as calendar
A SharePoint list is created on your site
OG API key is known
Knowledge of restful APIs and JSON parsing is a must.
1. the flow will get the timeline of OG for a given schedule (restful OG API call) Timeline since a certain date. Please note the entries in the JSON response will be sorted by date. Please also note - we will be getting the timeline since a certain date (in my example it is the last month and for the next 2 months (interval is 12 weeks) ) to ensure we have enough historical data to be rendered on the Sharepoint website. This is driven by the `utcOneMonthAgo` variable set to `
2. then the flow will clear up the existing list in Sharepoint, to make sure we don't get duplicate entries
3. then the flow will parse the JSON response obtained in the first step, using the JSON schema (generated from sample JSON response)
4. then the flow will loop through the parsed JSON and add the required attributes to the list, cleared up in step 2.
Additional settings in SharePoint list
The result of the flow will look like :
the list used in flow can be rendered as a calendar natively via SharePoint. Select list properties and create a new view, with the "Show as" option set to the calendar. Specify the fields for start and end dates
Now the new View can be used either as a default one in the list or, this view can be embedded into any Shapoint page contact where it is required.
Power Automate offers some great scriptless features to grab external data and place it into SharePoint as content.
Great write up, I'm trying to use Power Automate for this same process. I'm getting hung up on the "Apply to Each 2" portion. Any clues?
@Kade Kerschen I assume "Apply to Each 2" is referring to the same as I have in my screenshot.
If that's the case that assertion depended on a previous one (Parse JSON) which contains "schema"
To get the schema - make a sample ops genie call (via curl rest API) obtain the JSON response paste it into Parse Json assertion - and it will generate a schema out of that response.
There are a lot of unneeded details in that schema since the OG response contains a lot of irrelevant details for the purposes of what I need. Either clear all the non-needed attributes in the generated schema, or select the correct one from the list (they will be all named the same, like in the title example where I am referring to `name` twice, but those are different attributes one is for persona name, another one is for rotation name).
The thing is Power Automate UI will provide you a drop-down list with the colour-coded (by assertion) attribute suggestions, and if the extracted attribute names are the same - they will be displayed as duplicates, yet they would reference the actual parse4d json attributes.
I had to do a number of trial-and-error parsing attempts to get things running right
You can always log debug your flow and it will tell you better error output than the one you have mentioned