Skip to main content

getWorkedSituationsPerUserStats

A GET request that returns the number of Situations a user has worked on within a given time range.

Moogsoft Moogsoft Enterprise considers a user to have worked on a Situation if the user has:

  • Been assigned a Situation.

  • Been invited to a Situation.

  • Left a comment on a Situation.

  • Closed a Situation.

  • Resolved a Situation.

  • Executed a ChatOps tool on a Situation.

  • Rated a Situation.

  • Added PRC data to alerts in a Situation.

Back to Stats API.

Request arguments

Endpoint getWorkedSituationsPerUserStats takes the following request arguments.

Response

Endpoint getWorkedSituationsPerUserStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

"Worked Situations (full name)"

datapoints

Number Array

An array of data points. Each data point is an array in the format [data point, timestamp]:

  1. Data point: Number of Situations worked on by the user.

  • Less than 1 week: Returns the number of worked Situations each hour in the time period.

  • 1 week to 1 month: Returns the number of worked Situations each day in the time period.

  • 1 month to 1 year: Returns the number of worked Situations each week in the time period.

  • More than 1 year: Returns the number of worked Situations each month in the time period.

Examples

The following examples demonstrate typical use of endpoint getWorkedSituationsPerUserStats:

Request example

A cURL request to return the number of Situations worked on by user 5 from 12:22pm on Thursday 30th August until 8:22am Friday 31st August 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getWorkedSituationsPerUserStats" --data-urlencode 'users=[5]' --data-urlencode 'from=1535628143' --data-urlencode 'to=1535700143' --data-urlencode 'aggregation=none'

Response example

A successful response returns the number of Situations worked by the user Chris each hour during the time range:

[{
        "datapoints":[
                [12.0,1535628143000],
                [25.0,1535631743000],
                [33.0,1535635343000],
                [14.0,1535638943000],
                [1.0,1535642543000],
                [4.0,1535646143000],
                [9.0,1535649743000],
                [6.0,1535653343000],
                [37.0,1535656943000],
                [31.0,1535660543000],
                [19.0,1535664143000],
                [35.0,1535667743000],
                [36.0,1535671343000],
                [28.0,1535674943000],
                [30.0,1535678543000],
                [19.0,1535682143000],
                [21.0,1535685743000],
                [30.0,1535689343000],
                [35.0,1535692943000],
                [30.0,1535696543000]
        ],
        "target":"Worked Situations (Chris Cole)"
}]