Missed Team ’24? Catch up on announcements here.

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

Has anyone integrated Ops genie with share point for on call rota visibility for non ops genie user

Anish Singh December 12, 2022

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 ?

2 answers

1 accepted

1 vote
Answer accepted
Andrew Laden
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2022

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

  • To determine sharepoint order.
  • On call is first
  • Rotate the rotation till the next on call is first.
  • Add to order as long as it isnt in there already.

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

https://support.atlassian.com/opsgenie/docs/view-your-on-call-schedule/

that might be good enough for what you want to do.

Anish Singh December 13, 2022

Thanks Andrew, your answer is driving away from this solution, might be hard to maintain this in the long run with no devs on our side. Might use the teams and ical solution and see which gives me best results.

Like Andrew Laden likes this
0 votes
Boris Zozoulia August 10, 2023

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.

Prerequisites:

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.

Flow

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 `

subtractFromTime(utcNow(),1,'Month')` in the screenshot

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.

powerautomate-rota.png

Additional settings in SharePoint list

The result of the flow will look like :

default-list-view.png

 

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
calendar-view.png

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.

calendar-result.png

 

Power Automate offers some great scriptless features to grab external data and place it into SharePoint as content.

Good luck

Kade Kerschen
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!
September 13, 2023

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?

error.png

Boris Zozoulia September 19, 2023

@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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events