Obtenir un enregistrement

  • Rversion finale: Xanadu
  • Mis à jour 1 août 2024
  • 1 minute de lecture
  • Récupère un enregistrement unique en fonction des sys_id spécifiés à partir de la table spécifiée.

    Avant de commencer

    Rôle requis : sn_cli_metadata.cli_admin, sn_cli_metadata.cli_user ou admin

    Procédure

    Ouvrez l’outil en ligne de commande de votre système et exécutez cette commande.
    $ snc record get [--table table --sysid sys_id]

    Transmettez des valeurs pour ces arguments.

    Paramètre Description
    table Requis. Nom de la table à partir de laquelle récupérer l’enregistrement.
    sysid Requis. Sys_id de l’enregistrement à récupérer.

    Exemple

    $ snc record get --table incident --sysid 552c48888c033300964f4932b03eb092

    Le système renvoie l’enregistrement au format JSON.

    {
       "result": {
          "active": "true",
          "activity_due": "",
          "additional_assignee_list": "",
          "approval": "not requested",
          "approval_history": "",
          "approval_set": "",
          "assigned_to": "",
          "assignment_group": "",
          "business_duration": "",
          "business_service": "",
          "business_stc": "",
          "calendar_duration": "",
          "calendar_stc": "",
          "caller_id": {
             "link": "https://my-instance.service-now.com/api/now/table/sys_user/005d500b536073005e0addeeff7b12f4",
             "value": "005d500b536073005e0addeeff7b12f4"
          },
          "category": "inquiry",
          "caused_by": "",
          "child_incidents": "0",
          "close_code": "",
          "close_notes": "",
          "closed_at": "",
          "closed_by": "",
          "cmdb_ci": "",
          "comments": "",
          "comments_and_work_notes": "",
          "company": "",
          "contact_type": "",
          "contract": "",
          "correlation_display": "",
          "correlation_id": "",
          "delivery_plan": "",
          "delivery_task": "",
          "description": "",
          "due_date": "",
          "escalation": "0",
          "expected_start": "",
          "follow_up": "",
          "group_list": "",
          "hold_reason": "",
          "impact": "3",
          "incident_state": "1",
          "knowledge": "false",
          "location": "",
          "made_sla": "true",
          "notify": "1",
          "number": "INC0010112",
          "opened_at": "2019-07-29 18:48:43",
          "opened_by": {
             "link": "https://my-instance.service-now.com/api/now/table/sys_user/6816f79cc0a8016401c5a33be04be441",
             "value": "6816f79cc0a8016401c5a33be04be441"
          },
          "order": "",
          "parent": "",
          "parent_incident": "",
          "priority": "5",
          "problem_id": "",
          "reassignment_count": "0",
          "reopen_count": "0",
          "reopened_by": "",
          "reopened_time": "",
          "resolved_at": "",
          "resolved_by": "",
          "rfc": "",
          "route_reason": "",
          "service_offering": "",
          "severity": "3",
          "short_description": "Assessment :  ATF Assessor",
          "sla_due": "",
          "state": "1",
          "subcategory": "",
          "sys_class_name": "incident",
          "sys_created_by": "admin",
          "sys_created_on": "2019-07-29 18:49:28",
          "sys_domain": {
             "link": "https://my-instance.service-now.com/api/now/table/sys_user_group/global",
             "value": "global"
          },
          "sys_domain_path": "/",
          "sys_id": "552c48888c033300964f4932b03eb092",
          "sys_mod_count": "0",
          "sys_tags": "",
          "sys_updated_by": "admin",
          "sys_updated_on": "2019-07-29 18:49:28",
          "task_effective_number": "INC0010112",
          "time_worked": "",
          "universal_request": "",
          "upon_approval": "proceed",
          "upon_reject": "cancel",
          "urgency": "3",
          "user_input": "",
          "watch_list": "",
          "work_end": "",
          "work_notes": "",
          "work_notes_list": "",
          "work_start": ""
       }
    }