Performance Analytics API 예시

  • 릴리스 버전: Yokohama
  • 업데이트 날짜 2025년 01월 30일
  • 읽기59분
  • 다음 예제에서는 cURL 명령을 사용하여 REST 쿼리를 수행하는 방법을 보여 주고 각 명령에 대해 반환된 데이터를 보여 줍니다. 각 예제는 마지막 예제를 기반으로 빌드되며, 이후 예제는 이전 예제에서 반환된 데이터를 사용합니다.

    에 표시된 모든 표시기 반환 분석 허브

    고유 기록 식별자를 포함하여 에 분석 허브표시되는 모든 표시기 목록을 요청할 수 있습니다.
    주:
    이 예시에서는 macOS curl 명령에 대한 구문을 사용합니다. 구문은 Windows 다를 수 있습니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://instance.service-now.com/api/now/v1/pa/scorecards"

    다음 응답은 이 페이지의 다른 예에서 사용되는 오픈 인시던트 수 표시기만 표시하도록 잘렸습니다.

    //{
      "result" : [
    ...
      
        {
          "change_formatted" : "",
          "key" : false,
          "value_unit" : "",
          "value_formatted" : "",
          "period_title" : null,
          "gapperc" : null,
          "gap" : null,
          "target" : null,
          "period" : null,
          "target_formatted" : "",
          "favorite" : false,
          "direction_label" : "Minimize",
          "uuid" : "fb007202d7130100b96d45a3ce6103b4",
          "name" : "Number of open incidents",
          "value_color" : "#000000",
          "frequency_label" : "Daily",
          "change" : null,
          "gap_formatted" : "",
          "gapperc_formatted" : "",
          "value" : null,
          "unit" : {
            "display_value" : "#",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value" : "17b365e2d7320100ba986f14ce6103ad"
          },
          "changeperc_formatted" : "",
          "direction" : 2,
          "frequency" : 10,
          "precision" : 0,
          "changeperc" : null,
          "indicator" : {
            "display_value" : "Number of open incidents",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value" : "fb007202d7130100b96d45a3ce6103b4"
          },
          "description" : "Number of incidents open based on resolved date is empty."
        },
    ...
        
      ]
    }

    반환 표시기 상세 정보

    표시기 sys_id 값을 매개변수에 제공하여 sysparm_uuid 특정 표시기를 쿼리 분석 허브 할 수 있습니다. 이 경우 다음의 분석 허브모든 표시기를 가져올 때 첫 번째 예에서 검색한 오픈 인시던트 수 표시기에 시스템 ID를 사용합니다.
    "uuid" : "fb007202d7130100b96d45a3ce6103b4",
    "name" : "Number of open incidents",

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://instance.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4"

    응답:

    {
      "result" : [
        {
          "change_formatted" : "",
          "key" : false,
          "value_unit" : "",
          "value_formatted" : "",
          "period_title" : null,
          "gapperc" : null,
          "gap" : null,
          "target" : null,
          "period" : null,
          "target_formatted" : "",
          "favorite" : false,
          "direction_label" : "Minimize",
          "uuid" : "fb007202d7130100b96d45a3ce6103b4",
          "name" : "Number of open incidents",
          "value_color" : "#000000",
          "frequency_label" : "Daily",
          "change" : null,
          "gap_formatted" : "",
          "gapperc_formatted" : "",
          "value" : null,
          "unit" : {
            "display_value" : "#",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value" : "17b365e2d7320100ba986f14ce6103ad"
          },
          "changeperc_formatted" : "",
          "direction" : 2,
          "frequency" : 10,
          "precision" : 0,
          "changeperc" : null,
          "indicator" : {
            "display_value" : "Number of open incidents",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value" : "fb007202d7130100b96d45a3ce6103b4"
          },
          "description" : "Number of incidents open based on resolved date is empty."
        }
      ]
    }

    표시기에 대한 모든 세부 항목 및 집계 반환

    and sysparm_include_available_aggregates 매개변수를 true로 설정하여 표시기에 사용 가능한 세부 항목 및 집계 목록을 쿼리할 sysparm_include_available_breakdowns 수 있습니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://instance.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4&sysparm_include_available_breakdowns=true&sysparm_include_available_aggregates=true"

    응답:

    {
      "result" : [
        {
          "key" : false,
          "change_formatted" : "",
          "aggregates" : [
            {
              "display_value" : "7d running SUM",
              "link" : "https://instance.service-now.com/api/now/v1/table/pa_aggregates/89ea4c11d7001100ba986f14ce6103dc",
              "value" : "89ea4c11d7001100ba986f14ce6103dc"
            },
            {
              "display_value" : "28d running SUM",
              "link" : "https://instance.service-now.com/api/now/v1/table/pa_aggregates/4dfa4c11d7001100ba986f14ce6103e2",
              "value" : "4dfa4c11d7001100ba986f14ce6103e2"
            },
            {
              "display_value" : "30d running SUM",
              "link" : "https://instance.service-now.com/api/now/v1/table/pa_aggregates/3e409011d7001100ba986f14ce610319",
              "value" : "3e409011d7001100ba986f14ce610319"
            },
            // Aggregates truncated for brevity
            
          ],
          "changeperc" : null,
          "value_formatted" : "",
          "period_title" : null,
          "gapperc" : null,
          "value_unit" : "",
          "target" : null,
          "period" : null,
          "target_formatted" : "",
          "favorite" : false,
          "gap" : null,
          "direction_label" : "Minimize",
          "uuid" : "fb007202d7130100b96d45a3ce6103b4",
          "name" : "Number of open incidents",
          "value_color" : "#000000",
          "frequency_label" : "Daily",
          "change" : null,
          "gap_formatted" : "",
          "gapperc_formatted" : "",
          "value" : null,
          "unit" : {
            "display_value" : "#",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value" : "17b365e2d7320100ba986f14ce6103ad"
          },
          "breakdowns" : [
            {
              "display_value" : "Priority",
              "link" : "https://instance.service-now.com/api/now/v1/table/pa_breakdowns/0df47e02d7130100b96d45a3ce610399",
              "value" : "0df47e02d7130100b96d45a3ce610399"
            },
            {
              "display_value" : "Category",
              "link" : "https://instance.service-now.com/api/now/v1/table/pa_breakdowns/1f918835d7231100b96d45a3ce6103fe",
              "value" : "1f918835d7231100b96d45a3ce6103fe"
            },
            {
              "display_value" : "Assignment Group",
              "link" : "https://instance.service-now.com/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
              "value" : "baec0752bf130100b96dac808c0739ed"
            },
            // Information for State and Age indicators truncated
            
          ],
          "changeperc_formatted" : "",
          "frequency" : 10,
          "precision" : 0,
          "direction" : 2,
          "indicator" : {
            "display_value" : "Number of open incidents",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value" : "fb007202d7130100b96d45a3ce6103b4"
          },
          "description" : "Number of incidents open based on resolved date is empty."
        }
      ]
    }

    표시기 점수의 시계열 집계 반환

    7일 실행 SUM 집계 분석 허브 를 집계 sys_id와 함께 값을 사용하여 sysparm_uuid 적용할 수 있습니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://instance.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4:89ea4c11d7001100ba986f14ce6103dc"

    응답:

    {
      "result" : [
        {
          "key" : false,
          "change_formatted" : "",
          "value_unit" : "",
          "value_formatted" : "",
          "period_title" : null,
          "aggregate" : {
            "display_value" : "7d running SUM",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_aggregates/89ea4c11d7001100ba986f14ce6103dc",
            "value" : "89ea4c11d7001100ba986f14ce6103dc"
          },
          "gapperc" : null,
          "target" : null,
          "period" : null,
          "target_formatted" : "",
          "favorite" : false,
          "gap" : null,
          "direction_label" : "Minimize",
          "uuid" : "fb007202d7130100b96d45a3ce6103b4:89ea4c11d7001100ba986f14ce6103dc",
          "name" : "Number of open incidents / 7d running SUM",
          "value_color" : "#000000",
          "frequency_label" : "Daily",
          "change" : null,
          "gap_formatted" : "",
          "gapperc_formatted" : "",
          "value" : null,
          "unit" : {
            "display_value" : "#",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value" : "17b365e2d7320100ba986f14ce6103ad"
          },
          "changeperc_formatted" : "",
          "direction" : 2,
          "frequency" : 10,
          "precision" : 0,
          "changeperc" : null,
          "indicator" : {
            "display_value" : "Number of open incidents",
            "link" : "https://instance.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value" : "fb007202d7130100b96d45a3ce6103b4"
          },
          "description" : "Number of incidents open based on resolved date is empty."
        }
      ]
    }

    세부 항목에 대한 요소 반환

    세부 항목의 각 요소와 연관된 점수를 가져오고 해당 요소의 sys_ids 가져오려면 세부 항목의 sys_id와 함께 매개변수를 사용합니다 sysparm_breakdown . 이 예에서는 오픈 인시던트 수 표시기에 대한 할당 그룹 세부 항목의 요소를 가져옵니다. 이전 예에서 오픈 인시던트 수 표시기의 sys_id fb007202d7130100b96d45a3ce6103b4 , 할당 그룹 세부 항목의 sys_id baec0752bf130100b96dac808c0739ed 입니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://<instance>.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4&sysparm_breakdown=baec0752bf130100b96dac808c0739ed"

    응답은 각각 하나의 요소 객체를 포함하는 표시기 객체 집합으로 구성됩니다. 요소 개체에는 각각 개체의 이름과 sys_id 포함됩니다. 표시기에 대한 정보는 각 표시기 개체에 대해 동일하기 때문에 이 예제에서는 첫 번째 표시기 개체만 자세히 제공됩니다.

    응답:

    {
      "result":[
        { 
          "indicator": {
            "display_value":"Number of open incidents",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value":"fb007202d7130100b96d45a3ce6103b4"
          },
          "gap_formatted":"",
          "benchmarking":false,
          "frequency_label":"Daily",
          "changeperc_formatted":"0.0%",
          "direction_label":"Minimize",
          "precision":0,
          "breakdown": {
            "display_value":"Assignment Group",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
            "value":"baec0752bf130100b96dac808c0739ed"
          },
          "personal_target":null,
          "description":"Number of incidents open based on resolved date is empty.",
          "value_color":"#455464",
          "uuid":"fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:unmatched",
          "frequency":10,
          "gap":null,
          "value_unit":"14",
          "indicator_frequency":10,
          "value":14.0,
          "indicator_aggregate":1,
          "facts_table": {
            "name":"incident",
            "label":"Incidents"
          },
          "key":false,
          "indicator_frequency_label":"Daily",
          "direction":2,
          "element": {
            "display_value":"Unassigned",      //Element name
            "link":"https://<instance>.service-now.com/api/now/v1/table/sys_user_group/unmatched",
            "value":"unmatched"                //No sys_id for unmatched scores
          },
          "period_title":"Jul 22",
          "period":"Jul 22",
          "target_formatted":"",
          "change":0.0,
          "gapperc_formatted":"",
          "query":"opened_atONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^ORopened_at<javascript:gs.beginningOfToday()^resolved_atISEMPTY^ORresolved_at>javascript:gs.endOfToday()^state!=8",
          "realtime_enabled":true,
          "changeperc":0.0,
          "target":null,
          "unit": {
            "display_value":"#",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "type":"formatted",
            "value":"17b365e2d7320100ba986f14ce6103ad"
          },
          "value_formatted":"14",             // Score where Assignment Group=Unassigned
          "name":"Number of open incidents > Assignment Group = Unassigned",
          "gapperc":null,
          "change_formatted":"0",
          "favorite":false,
          "personal_target_formatted":""
        },
        {"indicator": {
          
          "element": {
            "display_value":"Software",
            "link":"https://<instance>.service-now.com/api/now/v1/table/sys_user_group/8a4dde73c6112278017a6a4baf547aa7",
            "value":"8a4dde73c6112278017a6a4baf547aa7"    // sys_id of element Software
          },
          ...
      
          "value_formatted":"6",                         // Score where Assignment Group: Software
          "name":"Number of open incidents > Assignment Group = Software",
          "gapperc":null,
          "change_formatted":"0",
          "favorite":false,
          "personal_target_formatted":""
        },
        {"indicator": {
          ...
       
          "element": {
            "display_value":"Service Desk",
            "link":"https://<instance>.service-now.com/api/now/v1/table/sys_user_group/d625dccec0a8016700a222a0f7900d06",
            "value":"d625dccec0a8016700a222a0f7900d06"   // sys_id of element Service Desk
          },
      
          ...
          
          "value_formatted":"5",                        // Score for Assignment Group: Service Desk
          "name":"Number of open incidents > Assignment Group = Service Desk",
          "gapperc":null,
          "change_formatted":"0",
          "favorite":false,
          "personal_target_formatted":""
        },
        {"indicator": {
      
          ...
          
          "element": {
            "display_value":"Hardware",
            "link":"https://<instance>.service-now.com/api/now/v1/table/sys_user_group/8a5055c9c61122780043563ef53438e3",
            "value":"8a5055c9c61122780043563ef53438e3"   // sys_id for element Hardware
          },
      
          ...
          
          "value_formatted":"3",                         // Score for Assignment Group: Hardware
          "name":"Number of open incidents > Assignment Group = Hardware",
          "gapperc":null,
          "change_formatted":"0",
          "favorite":false,
          "personal_target_formatted":""
        },
        {"indicator": {
      
      ...
    
          "element": {
            "display_value":"Network",
            "link":"https://<instance>.service-now.com/api/now/v1/table/sys_user_group/287ebd7da9fe198100f92cc8d1d2154e",
            "value":"287ebd7da9fe198100f92cc8d1d2154e"},  // sys_id for element Network
      
    ... 
    
          "value_formatted":"3",                          // Score for Assignment Group: Network
          "name":"Number of open incidents > Assignment Group = Network",
          "gapperc":null,
          "change_formatted":"0",
          "favorite":false,
          "personal_target_formatted":""
        },
      ...
      ]
    ...
    }
    

    세부 항목 및 요소로 필터링된 표시기 반환

    세부 항목 및 세부 항목 요소 sys_id 값을 매개변수에 sysparm_uuid 추가하여 세부 항목을 적용할 수 있습니다. 이 예에서는 우선순위 1 인시던트를 표시하도록 데이터가 세분화됩니다. 우선순위 세부 항목의 sys_id는 0df47e02d7130100b96d45a3ce610399 이며 표시기에 대한 모든 세부 항목 및 집계 반환 예제에 나와 있습니다. Return all elements for a breakdown과 동일한 명령을 실행하여 1 - 중요 요소에 대한 sys_id 가져올 수 있지만 할당 그룹 대신 우선순위 세부 항목을 사용합니다. 1 - 중요에 대한 sys_id은 5f012106db5123003ee8f93baf9619bd입니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://instance.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4:0df47e02d7130100b96d45a3ce610399:5f012106db5123003ee8f93baf9619bd"

    응답:

    {
    // The request is made Dec 12. The
    // score is 76, which is unchanged from
    // Dec 11, and which exceeds the
    // target of 70.
      "result": [ 
        { 
          "indicator": {
            "display_value":"Number of open incidents",
            "link":"https://instance.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value":"fb007202d7130100b96d45a3ce6103b4"
          },
          "gap_formatted":"-6",
          "benchmarking":false,
          "frequency_label":"Daily",
          "changeperc_formatted":"0.0%",
          "direction_label":"Minimize",
          "precision":0,
          "breakdown": {
            "display_value":"Priority",
            "link":"https://instance.service-now.com/api/now/v1/table/pa_breakdowns/0df47e02d7130100b96d45a3ce610399",
            "value":"0df47e02d7130100b96d45a3ce610399"
          },
          "personal_target":null,
          "description":"Number of incidents open based on resolved date is empty.",
          "value_color":"#ff8c00",
          "uuid":"fb007202d7130100b96d45a3ce6103b4:0df47e02d7130100b96d45a3ce610399:5f012106db5123003ee8f93baf9619bd",
          "frequency":10,
          "gap":-6.0,
          "value_unit":"76",
          "indicator_frequency":10,
          "value":76.0,
          "indicator_aggregate":1,
          "facts_table": {
            "name":"incident",
            "label":"Incidents"
          },
          "key":false,
          "indicator_frequency_label":"Daily",
          "direction":2,
          "element": {
            "display_value":"1 - Critical",
            "link":"https://instance.service-now.com/api/now/v1/table/sys_choice/5f012106db5123003ee8f93baf9619bd",
            "value":"5f012106db5123003ee8f93baf9619bd"
          },
          "period_title":"Dec 12",
          "period":"Dec 12",
          "target_formatted":"70",
          "change":0.0,
          "gapperc_formatted":"-8.6%",
          "query":"opened_atONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^ORopened_at<javascript:gs.beginningOfToday()^resolved_atISEMPTY^ORresolved_at>javascript:gs.endOfToday()^state!=8^priority=1^EQ",
          "realtime_enabled":true,
          "changeperc":0.0,
          "target":70.0,
          "unit": {
            "display_value":"#",
            "link":"https://instance.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "type":"formatted","value":"17b365e2d7320100ba986f14ce6103ad"
          },
          "value_formatted":"76",
          "name":"Number of open incidents > Priority = 1 - Critical",
          "gapperc":-0.08571428571428572,
          "change_formatted":"0",
          "favorite":true,
          "personal_target_formatted":""
        }
      ]
    }

    위치별로 세분화된 표시기 반환

    Performance Analytics API는 사용 가능한 경우 지리적 위치 데이터를 반환합니다.

    명령:
    curl -v -u "user:password" -H "Accept:application/json" "https://<instance>.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4&sysparm_breakdown=656d5662eb23310065deac6aa206fee7"
    응답:
    {
      "result": [
        {
          ...
          "element": {
            "display_value": "San Diego",
            "link": "https://<instance>.service-now.com/api/now/v1/table/cmn_location/108752c8c611227501d4ab0e392ba97f",
            "value": "108752c8c611227501d4ab0e392ba97f",
            "longitude": -117.15726,
            "latitude": 32.71533
          },
          ...
        }
        {
          ...
          "element": {
            "display_value": "Florida",
            "link": "https://<instance>.service-now.com/api/now/v1/table/cmn_location/8e3e85f037d0200044e0bfc8bcbe5d14",
            "value": "8e3e85f037d0200044e0bfc8bcbe5d14",
            "longitude": -95.71289,
            "latitude": 37.09024
          },
          ...
        }
      ]
    }

    첫 번째 및 두 번째 수준 세부 항목 점수 반환

    매개변수에 두 개의 세부 항목 sys_ids 추가하여 두 가지 수준의 세부 항목을 적용할 수 있습니다 sysparm_uuid . 이 예에서는 데이터를 우선순위별로 세분화하여 우선순위 1 인시던트를 표시하고 범주별로 분석하여 데이터베이스 인시던트를 표시합니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://instance.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4:0df47e02d7130100b96d45a3ce610399:e5900140200331007665978299a805f3:1f918835d7231100b96d45a3ce6103fe:9e418d40200331007665978299a805c1"

    응답:

    {
      "result": [
        {
          "value_formatted": "",
          "indicator": {
            "display_value": "Number of open incidents",
            "link": "http://instance.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value": "fb007202d7130100b96d45a3ce6103b4"
          },
          "gapperc": null,
          "change": null,
          "value_color": "#000000",
          "direction": 2,
          "target_formatted": "",
          "frequency": 10,
          "changeperc_formatted": "",
          "direction_label": "Minimize",
          "period_title": null,
          "description": "Number of incidents open based on resolved date is empty.",
          "name": "Number of open incidents / Priority / 1 - Critical / Category / Database",
          "value": null,
          "key": false,
          "gap_formatted": "",
          "element": {
            "display_value": "1 - Critical",
            "link": "http://instance.service-now.com/api/now/v1/table/sys_choice/e5900140200331007665978299a805f3",
            "value": "e5900140200331007665978299a805f3"
          },
          "precision": 0,
          "element_level2": {
            "display_value": "Database",
            "link": "http://instance.service-now.com/api/now/v1/table/sys_choice/9e418d40200331007665978299a805c1",
            "value": "9e418d40200331007665978299a805c1"
          },
          "breakdown": {
            "display_value": "Priority",
            "link": "http://instance.service-now.com/api/now/v1/table/pa_breakdowns/0df47e02d7130100b96d45a3ce610399",
            "value": "0df47e02d7130100b96d45a3ce610399"
          },
          "period": null,
          "favorite": false,
          "change_formatted": "",
          "unit": {
            "display_value": "#",
            "link": "http://instance.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value": "17b365e2d7320100ba986f14ce6103ad"
          },
          "frequency_label": "Daily",
          "breakdown_level2": {
            "display_value": "Category",
            "link": "http://instance.service-now.com/api/now/v1/table/pa_breakdowns/1f918835d7231100b96d45a3ce6103fe",
            "value": "1f918835d7231100b96d45a3ce6103fe"
          },
          "target": null,
          "changeperc": null,
          "uuid": "fb007202d7130100b96d45a3ce6103b4:0df47e02d7130100b96d45a3ce610399:e5900140200331007665978299a805f3:1f918835d7231100b96d45a3ce6103fe:9e418d40200331007665978299a805c1",
          "gapperc_formatted": "",
          "value_unit": "",
          "gap": null
        }
      ]
    }

    두 가지 수준의 세부 항목에 대해 날짜 범위에서 점수 반환

    매개변수를 true로 설정하여 sysparm_include_scores 사용 가능한 모든 날짜에 대한 개별 점수 목록을 요청할 수 있습니다. 점수의 날짜 범위를 지정하려면 and sysparm_to 매개 변 sysparm_from 수도 사용합니다. 이 예시에서 수준 1 세부 항목 및 요소는 할당 그룹: 소프트웨어(sys_id baec0752bf130100b96dac808c0739ed8a4dde73c6112278017a6a4baf547aa7)입니다. 수준 2 세부 항목 및 요소는 우선 순위: 1 - 중요(sys_id 0df47e02d7130100b96d45a3ce610399e5900140200331007665978299a805f3)입니다. 2018년 11월 30일 이후의 점수만 반환됩니다.

    명령:

    curl -v -u "resttest:resttest" -H "Accept:application/json" "https://<instance>.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:8a4dde73c6112278017a6a4baf547aa7:0df47e02d7130100b96d45a3ce610399:e5900140200331007665978299a805f3&sysparm_include_scores=true&sysparm_from=2018-11-30"

    응답:

    {
      "result": [
        { "indicator": {
            "display_value":"Number of open incidents",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value":"fb007202d7130100b96d45a3ce6103b4"
          },
          "gap_formatted":"",
          "benchmarking":false,
          "frequency_label":"Daily",
          "scores": [
            { "end_at":"2018-12-04",
              "period":"Dec 04",
              "value_formatted":"2",
              "start_at":"2018-12-04",
              "value":2.0
            },
            ...
           
            { "end_at":"2018-11-30",
              "period":"Nov 30",
              "value_formatted":"0",
              "start_at":"2018-11-30",
              "value":0.0
            }
          ],
          "changeperc_formatted":"",
          "direction_label":"Minimize",
          "precision":0,
          "breakdown": {                      //First-level breakdown
            "display_value":"Assignment Group",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
            "value":"baec0752bf130100b96dac808c0739ed"
          },
          "personal_target":null,
          "description":"Number of incidents open based on resolved date is empty.",
          "value_color":"#455464",
          "uuid":"fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:8a4dde73c6112278017a6a4baf547aa7:0df47e02d7130100b96d45a3ce610399:e5900140200331007665978299a805f3",
          "frequency":10,
          "gap":null,
          "value_unit":"2",
          "indicator_frequency":10,
          "value":2.0,
          "indicator_aggregate":1,
          "key":false,
          "indicator_frequency_label":"Daily",
          "direction":2,
          "element": {                        //First-level breakdown element
            "display_value":"Software",
            "link":"https://<instance>.service-now.com/api/now/v1/table/sys_user_group/8a4dde73c6112278017a6a4baf547aa7",
            "value":"8a4dde73c6112278017a6a4baf547aa7"
          },
          "period_title":"Dec 04",
          "period":"Dec 04",
          "target_formatted":"",
          "change":2.0,
          "gapperc_formatted":"",
          "realtime_enabled":false,
          "changeperc":null,
          "target":null,
          "unit":{ 
            "display_value":"#",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "type":"formatted",
            "value":"17b365e2d7320100ba986f14ce6103ad"
          },
          "value_formatted":"2",               //Second-level breakdown and element
          "name":"Number of open incidents > Assignment Group = Software > Priority = e5900140200331007665978299a805f3",
          "gapperc":null,
          "change_formatted":"2",
          "favorite":false,
          "breakdown_level2": {
            "display_value":"Priority",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_breakdowns/0df47e02d7130100b96d45a3ce610399",
            "value":"0df47e02d7130100b96d45a3ce610399"
          },
          "personal_target_formatted":""
        }
      ]
    }

    세분화 및 요소에 대한 세분화 관계 반환

    표시기와 연관된 모든 세분화 관계에 대한 sys_id 값을 구하려면 매개변수를 사용하십시오 sysparm_include_available_breakdowns . 매개변수에는 sysparm_uuid 첫 번째 수준 세부 항목의 sys_ids 및 관계를 찾으려는 요소를 포함합니다. 이 예시에서 매개변수에는 sysparm_uuid 할당 그룹 세부 항목에 대한 sys_id와 소프트웨어 요소에 대한 sys_id 포함됩니다. 모든 세부 항목 및 집계가 반환된 예에서 할당 그룹의 sys_id 얻었습니다. Software 요소의 sys_id은 할당 그룹의 모든 요소가 반환된 이전 예에서 가져온 것입니다. 할당 그룹 세부 항목의 sys_id은 baec0752bf130100b96dac808c0739ed 이고 소프트웨어 요소의 은 8a4dde73c6112278017a6a4baf547aa7입니다. 세부 항목 관계는 sys_id가 fb007202d7130100b96d45a3ce6103b4인 오픈 인시던트 수 표시기에 대해 가져옵니다.

    주:
    할당 그룹: 할당되지 않음과 같이 세분화의 요소 값과 일치하지 않는 인시던트에 대한 세분화 관계를 찾으려면 요소 sys_id 대신 unmatched 문자열을 사용합니다. 이 경우 매개변수는 sysparm_uuid=fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:unmatched입니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://<instance>.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:8a4dde73c6112278017a6a4baf547aa7&sysparm_include_available_breakdowns=true"

    응답:

    {
      "result": [
        {
          "value_formatted": "37",
          "indicator": {
            "display_value": "Number of open incidents",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value": "fb007202d7130100b96d45a3ce6103b4"
          },
          "gapperc": null,
          "change": 9.0,
          "value_color": "#455464",
          "direction": 2,
          "target_formatted": "",
          "frequency": 10,
          "changeperc_formatted": "32.1%",
          "direction_label": "Minimize",
          "period_title": "Jul 22",
          "description": "Number of incidents open based on resolved date is empty.",
          "name": "Number of open incidents / Assignment Group / Software",
          "value": 37.0,
          "key": false,
          "gap_formatted": "",
          "element": {
            "display_value": "Software",
            "link": "https://<instance>.service-now.com/api/now/v1/table/sys_user_group/287ee6fea9fe198100ada7950d0b1b73",
            "value": "8a4dde73c6112278017a6a4baf547aa7"
          },
          "precision": 0,
          "breakdowns": [
            // Information about each breakdown
            
          ],
          "breakdown_relations": [
            {
              "display_value": "Child Groups",
              "link": "https://<instance>.service-now.com/api/now/v1/table/pa_breakdown_relations/301fd511eb23310065deac6aa206fe31",
              "value": "301fd511eb23310065deac6aa206fe31"
            },
            {
              "display_value": "Parent Group",
              "link": "https://<instance>.service-now.com/api/now/v1/table/pa_breakdown_relations/790b6e11eb23310065deac6aa206fe1c",
              "value": "790b6e11eb23310065deac6aa206fe1c"
            },
            {
              "display_value": "Sibling Groups",
              "link": "https://<instance>.service-now.com/api/now/v1/table/pa_breakdown_relations/15e15a12eb233100871aac6aa206fe59",
              "value": "15e15a12eb233100871aac6aa206fe59"
            }
          ],
          "breakdown": {
            "display_value": "Assignment Group",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
            "value": "baec0752bf130100b96dac808c0739ed"
          },
          "period": "Jul 22",
          "favorite": false,
          "change_formatted": "9",
          "unit": {
            "display_value": "#",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value": "17b365e2d7320100ba986f14ce6103ad"
          },
          "frequency_label": "Daily",
          "target": null,
          "changeperc": 0.32142857142857145,
          "uuid": "fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:8a4dde73c6112278017a6a4baf547aa7",
          "gapperc_formatted": "",
          "value_unit": "6",
          "gap": null
        }
      ]
    }

    세부 항목 관계를 사용하는 표시기 반환

    세부 항목 관계를 사용하려면 매개변수에 표시기, 세부 항목 및 요소의 sys_id 값과 매개변수에 sysparm_uuidsysparm_breakdown_relation 세부 항목 관계의 sys_id 포함합니다. 이 예에서는 이전 예의 할당 그룹: 소프트웨어에 대한 형제 그룹 값을 반환합니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://<instance>.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:8a4dde73c6112278017a6a4baf547aa7&sysparm_breakdown_relation=15e15a12eb233100871aac6aa206fe59"

    응답:

    {
      "result": [
        {
          "indicator": {
          "gap_formatted":"",
          "benchmarking":false,
          "frequency_label":"Daily",
          "changeperc_formatted":"0.0%",
          "direction_label":"Minimize",
          "precision":0,
          "breakdown": {
            "display_value":"Assignment Group",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
            "value":"baec0752bf130100b96dac808c0739ed"
          },
          "personal_target":null,
          "description":"Number of incidents open based on resolved date is empty",
          "value_color":"#455464",
          "uuid":"fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:0a52d3dcd7011200f2d224837e6103f2",
          "frequency":10,
          "gap":null,
          "value_unit":"0",
          "indicator_frequency":10,
          "value":0.0,
          "indicator_aggregate":1,
          "facts_table": {
            "name":"incident",
            "label":"Incidents"
          },
          "key":false,
          "indicator_frequency_label":"Daily",
          "direction":2,
          "element": {
            "display_value":"Application Development",
            "link":"https://<instance>.service-now.com/api/now/v1/table/sys_user_group/0a52d3dcd7011200f2d224837e6103f2",
            "value":"0a52d3dcd7011200f2d224837e6103f2"
          },
          "period_title":"Dec 03",
          "period":"Dec 03",
          "target_formatted":"",
          "change":0.0,
          "gapperc_formatted":"",
          "query":"opened_atONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^ORopened_at<javascript:gs.beginningOfToday()^resolved_atISEMPTY^ORresolved_at>javascript:gs.endOfToday()^state!=8^assignment_group=0a52d3dcd7011200f2d224837e6103f2^EQ",
          "realtime_enabled":true,
          "changeperc":0.0,
          "target":null,
          "unit": {
            "display_value":"#",
            "link":"https://<instance>.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "type":"formatted",
            "value":"17b365e2d7320100ba986f14ce6103ad"
          },
          "value_formatted":"0",
          "name":"Number of open incidents > Assignment Group = Application Development",
          "gapperc":null,
          "change_formatted":"0",
          "favorite":false,
          "personal_target_formatted":""
        }
        // Followed by an indicator object with an element object for every element in the Sibling Group
      ]
    }

    세부 항목에 대해 필터링된 요소 세트 반환

    퍼포먼스 분석 요소 필터 기록의 sys_id와 함께 sysparm_elements_filter 매개변수를 사용하여 데이터에 필터를 분석 허브 적용할 수 있습니다.

    설명된 대로 요소 필터 기록에서 요소 필터의 sys_id 가져옵니다.

    이 예에서 요소 필터는 [[Parent][is][Database]] 조건과 함께 그룹 세부 항목 소스에 적용됩니다. 이 요소 필터의 sys_id은 7b9eb563eb11020065deac6aa206fe11입니다. 이 예에서는 Database 요소가 상위로 포함된 할당 그룹 세부 항목의 요소를 가져옵니다.

    명령:

    curl -v -u "user:password" -H "Accept:application/json" "https://<instance>.service-now.com/api/now/v1/pa/scorecards?sysparm_uuid=fb007202d7130100b96d45a3ce6103b4&sysparm_breakdown=baec0752bf130100b96dac808c0739ed&sysparm_elements_filter=7b9eb563eb11020065deac6aa206fe11"

    응답:

    {
      "result": [
        {
          "value_formatted": "37",
          "indicator": {
            "display_value": "Number of open incidents",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value": "fb007202d7130100b96d45a3ce6103b4"
          },
          "gapperc": null,
          "change": 9.0,
          "value_color": "#455464",
          "direction": 2,
          "target_formatted": "",
          "frequency": 10,
          "changeperc_formatted": "32.1%",
          "direction_label": "Minimize",
          "period_title": "Jul 22",
          "description": "Number of incidents open based on resolved date is empty.",
          "name": "Number of open incidents / Assignment Group / Database",
          "value": 37.0,
          "key": false,
          "gap_formatted": "",
          "element": {
            "display_value": "Database",
            "link": "https://<instance>.service-now.com/api/now/v1/table/sys_user_group/287ee6fea9fe198100ada7950d0b1b73",
            "value": "287ee6fea9fe198100ada7950d0b1b73"
          },
          "precision": 0,
          "breakdown": {
            "display_value": "Assignment Group",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
            "value": "baec0752bf130100b96dac808c0739ed"
          },
          "period": "Jul 22",
          "favorite": false,
          "change_formatted": "9",
          "unit": {
            "display_value": "#",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value": "17b365e2d7320100ba986f14ce6103ad"
          },
          "frequency_label": "Daily",
          "target": null,
          "changeperc": 0.32142857142857145,
          "uuid": "fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:287ee6fea9fe198100ada7950d0b1b73",
          "gapperc_formatted": "",
          "value_unit": "37",
          "gap": null
        },
        {
          "value_formatted": "20",
          "indicator": {
            "display_value": "Number of open incidents",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value": "fb007202d7130100b96d45a3ce6103b4"
          },
          // Database Atlanta
          "gapperc": null,
          "change": 4.0,
          "value_color": "#455464",
          "direction": 2,
          "target_formatted": "",
          "frequency": 10,
          "changeperc_formatted": "25.0%",
          "direction_label": "Minimize",
          "period_title": "Jul 22",
          "description": "Number of incidents open based on resolved date is empty.",
          "name": "Number of open incidents / Assignment Group / Database Atlanta",
          "value": 20.0,
          "key": false,
          "gap_formatted": "",
          "element": {
            "display_value": "Database Atlanta",
            "link": "https://<instance>.service-now.com/api/now/v1/table/sys_user_group/db53580b0a0a0a6501aa37c294a2ba6b",
            "value": "db53580b0a0a0a6501aa37c294a2ba6b"
          },
          "precision": 0,
          "breakdown": {
            "display_value": "Assignment Group",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
            "value": "baec0752bf130100b96dac808c0739ed"
          },
          "period": "Jul 22",
          "favorite": false,
          "change_formatted": "4",
          "unit": {
            "display_value": "#",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value": "17b365e2d7320100ba986f14ce6103ad"
          },
          "frequency_label": "Daily",
          "target": null,
          "changeperc": 0.25,
          "uuid": "fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:db53580b0a0a0a6501aa37c294a2ba6b",
          "gapperc_formatted": "",
          "value_unit": "20",
          "gap": null
        },
        {
          "value_formatted": "19",
          "indicator": {
            "display_value": "Number of open incidents",
            "link": "https://<instance>.service-now.com/api/now/v1/table/pa_indicators/fb007202d7130100b96d45a3ce6103b4",
            "value": "fb007202d7130100b96d45a3ce6103b4"
          },
          ...
          
          // Database San Diego
          "gapperc": null,
          "change": 0.0,
          "value_color": "#455464",
          "direction": 2,
          "target_formatted": "",
          "frequency": 10,
          "changeperc_formatted": "0.0%",
          "direction_label": "Minimize",
          "period_title": "Jul 22",
          "description": "Number of incidents open based on resolved date is empty.",
          "name": "Number of open incidents / Assignment Group / Database San Diego",
          "value": 10.0,
          "key": false,
          "gap_formatted": "",
          "element": {
            "display_value": "Database San Diego",
            "link": "https://<instance>.service-now.com/api/now/v1/table/sys_user_group/db53a9290a0a0a650091abebccf833c6",
            "value": "db53a9290a0a0a650091abebccf833c6"
          },
          "precision": 0,
          "breakdown": {
            "display_value": "Assignment Group",
            "link": "http://localhost:8080/api/now/v1/table/pa_breakdowns/baec0752bf130100b96dac808c0739ed",
            "value": "baec0752bf130100b96dac808c0739ed"
          },
          "period": "Jul 22",
          "favorite": false,
          "change_formatted": "0",
          "unit": {
            "display_value": "#",
            "link": "http://<instance>.service-now.com/api/now/v1/table/pa_units/17b365e2d7320100ba986f14ce6103ad",
            "value": "17b365e2d7320100ba986f14ce6103ad"
          },
          "frequency_label": "Daily",
          "target": null,
          "changeperc": 0.0,
          "uuid": "fb007202d7130100b96d45a3ce6103b4:baec0752bf130100b96dac808c0739ed:db53a9290a0a0a650091abebccf833c6",
          "gapperc_formatted": "",
          "value_unit": "10",
          "gap": null
        }
      ]
    }