{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"ServiceNow Application Vulnerability Findings Import Setup Guide","siteUrl":"https://docs.synqly.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"servicenow-application-vulnerability-findings-import-setup-guide","__idx":0},"children":["ServiceNow Application Vulnerability Findings Import Setup Guide"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide configures your ServiceNow instance to receive ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["application"]}," vulnerability findings via the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Import Set REST API"]},". Findings are first posted to a staging table where a transform ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBefore"]}," script (described below) creates or updates ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Discovered Applications"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Application Vulnerability Entries"]},", and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Application Vulnerable Items (AVITs)"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Complete the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/provider-configuration/appsec-servicenow-setup"},"children":["ServiceNow Application Vulnerability Response Configuration Guide"]}," first. You need a service account, matching role assignments, and credentials in Synqly."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["REST API key (API Key tab):"]}," Also create REST API Access Policies for Table API in the main guide and Import Set API (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/provider-configuration/appsec-servicenow-setup#appsec-sn-token-step-6-import-set-policy"},"children":["step 6"]},")."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Basic credentials:"]}," Assign the same roles on the integration user. REST API Access Policies are not used for basic auth—access is enforced through roles and ACLs."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"create_findings\n   ↓  POST /api/now/import/u_avr_staging/insertMultiple\nStaging table (u_avr_staging)\n   ↓  Transform map (onBefore script only — no Field Maps)\n   ├── sn_vul_app_release           (Discovered Application)\n   ├── sn_vul_app_vul_entry         (Application Vulnerability Entry)\n   └── sn_vul_app_vulnerable_item   (AVIT / finding)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"upsert-keys","__idx":2},"children":["Upsert keys"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Table"},"children":["Table"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Natural key"},"children":["Natural key"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sn_vul_app_release"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source_app_id"]}," (any source — reuses existing scanner rows)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sn_vul_app_vul_entry"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," (global — reuses GH-GHSA/CVE rows from GitHub etc.)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sn_vul_app_vulnerable_item"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(application_release, vulnerability, source_avit_id)"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-create-staging-table-and-columns","__idx":3},"children":["1. Create staging table and columns"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"11-create-the-table","__idx":4},"children":["1.1 Create the table"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["All > System Definition > Tables"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_avr_staging"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Label"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AVR Staging"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Extends table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Import Set Row"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sys_import_set_row"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create access controls"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["checked"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Submit"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"12-add-columns","__idx":5},"children":["1.2 Add columns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the new table, go to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Columns"]}," related list, and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]}," for each column below."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All columns are type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["String"]}," unless noted."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Label"},"children":["Label"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Column name"},"children":["Column name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Max length"},"children":["Max length"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Purpose"},"children":["Purpose"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integration name (Synqly default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Synqly AVR"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source application ID"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_application_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["255"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}," — external app id (e.g. GitHub repo id)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Application name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_application_name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["255"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Display name (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["org/repo"]},") — maps to release ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Application description"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_application_description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional app/repo metadata"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["CMDB CI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_cmdb_ci"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["32"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional existing CI sys_id (32-char hex)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Business application"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_business_application"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["255"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional name to lookup ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cmdb_ci_business_app"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vulnerability ID"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_vulnerability_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["255"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}," — GH-GHSA, CVE, QID, etc."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vulnerability name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_vulnerability_name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["255"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Entry title"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Vulnerability summary"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_vulnerability_summary"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Entry / finding description"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Primary CWE"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_primary_cwe"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["40"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional, e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CWE-468"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source severity"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_severity"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["40"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Scanner severity (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["high"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4"]},", etc.)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source AVIT ID"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_avit_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["255"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}," — unique finding id from scanner"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Scan type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_scan_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["40"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Static"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Dynamic"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SCA"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Location"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_location"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["500"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["File:line, URL, path"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source link"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_link"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1024"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Deep link to finding"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source finding status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_finding_status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["40"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["open"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fixed"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dismissed"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["State"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_state"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["40"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["AVIT state override (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," = Open)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["First found"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_first_found_dt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["40"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YYYY-MM-DD"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YYYY-MM-DD HH:MM:SS"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Last found"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_last_found_dt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["40"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YYYY-MM-DD"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YYYY-MM-DD HH:MM:SS"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-create-data-source","__idx":6},"children":["2. Create data source"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["All > System Import Sets > Administration > Data Sources"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AVR REST Import"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Import set table name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_avr_staging"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Import set table label"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AVR Staging"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Active"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["true"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Submit"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3-configure-rest-insert-multiple-required-for-batch-api","__idx":7},"children":["3. Configure REST Insert Multiple (required for batch API)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This ensures ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST .../insertMultiple"]}," maps JSON keys to column ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["element names"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_*"]},"), not labels."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["All > System Definition > Tables"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search for table ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sys_rest_insert_multiple"]}]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open that table list."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AVR insertMultiple"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_avr_staging"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transformation / Mode"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Synchronous"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Active"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["checked"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Submit"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"31-column-mapping-related-list","__idx":8},"children":["3.1 Column mapping (related list)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Stay on the record you just created."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Scroll to related list ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column Mapping"]}," (or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column Mappings"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Column mapping"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column name"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Do not use Label"]}," — the default Label mapping causes empty staging rows when JSON uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_application_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_vulnerability_id"]},", and other element names."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Submit"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You only need ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["one"]}," Column Mapping row with ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column name"]}," for the entire staging table."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"4-create-transform-map-no-field-maps","__idx":9},"children":["4. Create transform map (no Field Maps)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"41-create-the-map","__idx":10},"children":["4.1 Create the map"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["All > System Import Sets > Administration > Transform Maps"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AVR Findings Import"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Source table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_avr_staging"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Target table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Application Vulnerable Item"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sn_vul_app_vulnerable_item"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Active"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["checked"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run business rules"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["checked"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Submit"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"42-do-not-add-field-maps","__idx":11},"children":["4.2 Do not add Field Maps"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Leave the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Field Maps"]}," related list ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["empty"]},". All logic runs in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBefore"]}," script via GlideRecord."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"43-add-onbefore-transform-script","__idx":12},"children":["4.3 Add onBefore transform script"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AVR Findings Import"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Go to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Transform Scripts"]}," related list (or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Transformation script"]}," tab) and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBefore"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Order"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["100"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Active"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["checked"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Paste the script below into ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Script"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Submit"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"onbefore-script","__idx":13},"children":["onBefore script"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"(function runTransformScript(source, map, log, target) {\n\n    var DEFAULT_SOURCE = 'AVR Integration';\n    var APP_RELEASE_TABLE = 'sn_vul_app_release';\n    var APP_VUL_ENTRY_TABLE = 'sn_vul_app_vul_entry';\n    var AVIT_TABLE = 'sn_vul_app_vulnerable_item';\n    var BUSINESS_APP_TABLE = 'cmdb_ci_business_app';\n\n    function str(field) {\n        if (field == null || field === '')\n            return '';\n        return field.toString().trim();\n    }\n\n    function isSysId(value) {\n        return /^[a-f0-9]{32}$/i.test(str(value));\n    }\n\n    function parseDateParts(dtStr) {\n        dtStr = str(dtStr);\n        if (!dtStr)\n            return { dtTm: '', date: '' };\n        // Accept YYYY-MM-DD or YYYY-MM-DD HH:MM:SS\n        if (dtStr.length >= 19)\n            return { dtTm: dtStr.substr(0, 19), date: dtStr.substr(0, 10) };\n        if (dtStr.length >= 10)\n            return { dtTm: dtStr.substr(0, 10) + ' 00:00:00', date: dtStr.substr(0, 10) };\n        return { dtTm: '', date: '' };\n    }\n\n    function resolveBusinessAppSysId(nameOrSysId) {\n        var raw = str(nameOrSysId);\n        if (!raw)\n            return '';\n\n        if (isSysId(raw))\n            return raw.toLowerCase();\n\n        var ba = new GlideRecord(BUSINESS_APP_TABLE);\n        ba.addQuery('name', raw);\n        ba.setLimit(1);\n        ba.query();\n        if (ba.next())\n            return ba.getValue('sys_id');\n\n        log.warn('Business application not found by name: ' + raw);\n        return '';\n    }\n\n    function upsertAppRelease(sourceName, sourceAppId, appName, appDesc, cmdbCi, businessAppSysId, log) {\n        var rel = new GlideRecord(APP_RELEASE_TABLE);\n\n        // Reuse by source_app_id (any source) — avoids duplicate GitHub + integration rows\n        if (sourceAppId) {\n            rel.addQuery('source_app_id', sourceAppId);\n            rel.orderByDesc('sys_updated_on');\n            rel.setLimit(1);\n            rel.query();\n        }\n\n        var isNew = !rel.next();\n        if (isNew) {\n            rel.initialize();\n            rel.source = sourceName;\n        }\n\n        // Always set keys + display (insert AND update)\n        if (sourceAppId && rel.isValidField('source_app_id'))\n            rel.setValue('source_app_id', sourceAppId);\n\n        var displayName = appName || appDesc || ('App ' + sourceAppId);\n        if (rel.isValidField('name'))\n            rel.setValue('name', displayName);\n\n        if (appDesc && rel.isValidField('description'))\n            rel.description = appDesc;\n\n        var ciSysId = isSysId(cmdbCi) ? cmdbCi : businessAppSysId;\n        if (isSysId(ciSysId)) {\n            if (rel.isValidField('configuration_item'))\n                rel.configuration_item = ciSysId;\n            if (rel.isValidField('business_application') && !rel.business_application)\n                rel.business_application = ciSysId;\n        } else if (isSysId(businessAppSysId) && rel.isValidField('business_application'))\n            rel.business_application = businessAppSysId;\n\n        if (isNew && !rel.source)\n            rel.source = sourceName;\n\n        var ok = isNew ? rel.insert() : rel.update();\n        var sysId = rel.getValue('sys_id');\n\n        if (!isSysId(sysId) || ok === false || ok === null) {\n            log.error('Failed to upsert app release: ' + rel.getLastErrorMessage());\n            return '';\n        }\n        return sysId;\n    }\n\n    function upsertAppVulEntry(sourceName, vulnId, vulnName, vulnSummary, sourceSeverity, primaryCwe, log) {\n        var entry = new GlideRecord(APP_VUL_ENTRY_TABLE);\n\n        // Reuse by id globally (GH-GHSA/CVE already imported by GitHub, etc.)\n        entry.addQuery('id', vulnId);\n        entry.setLimit(1);\n        entry.query();\n\n        var isNew = !entry.next();\n        if (!isNew) {\n            var changed = false;\n            if (vulnSummary && entry.isValidField('summary') && entry.summary != vulnSummary) {\n                entry.summary = vulnSummary;\n                changed = true;\n            }\n            if (changed) {\n                if (!entry.update()) {\n                    log.error('Failed to update app vul entry id=' + vulnId + ': ' + entry.getLastErrorMessage());\n                    return '';\n                }\n            }\n            return entry.getValue('sys_id');\n        }\n\n        // Create only when id does not exist anywhere\n        entry.initialize();\n        entry.source = sourceName;\n        entry.id = vulnId;\n        entry.name = vulnName || vulnId;\n\n        if (vulnSummary) {\n            if (entry.isValidField('summary'))\n                entry.summary = vulnSummary;\n            else if (entry.isValidField('short_description'))\n                entry.short_description = vulnSummary;\n        }\n\n        if (sourceSeverity && entry.isValidField('source_severity'))\n            entry.source_severity = sourceSeverity;\n\n        if (primaryCwe && entry.isValidField('primary_cwe')) {\n            var cweId = primaryCwe.replace(/^CWE-/i, 'CWE-');\n            if (!/^CWE-/i.test(cweId))\n                cweId = 'CWE-' + cweId.replace(/^CWE-/i, '');\n            var cweGr = new GlideRecord('sn_vul_cwe');\n            if (cweGr.isValid()) {\n                cweGr.addQuery('id', cweId);\n                cweGr.setLimit(1);\n                cweGr.query();\n                if (cweGr.next())\n                    entry.primary_cwe = cweGr.getValue('sys_id');\n            }\n        }\n\n        var sysId = entry.insert();\n        if (!isSysId(sysId)) {\n            log.error('Failed to insert app vul entry id=' + vulnId + ': ' + entry.getLastErrorMessage());\n            return '';\n        }\n        return sysId;\n    }\n\n    function resolveAvitState(sourceState, sourceFindingStatus) {\n        if (sourceState)\n            return sourceState;\n\n        var status = str(sourceFindingStatus).toLowerCase();\n        if (!status)\n            return '1'; // Open\n\n        if (status === 'open' || status === 'new')\n            return '1';\n        if (status === 'fixed' || status === 'closed' || status === 'resolved')\n            return '3';\n        if (status === 'dismissed' || status === 'suppressed')\n            return '5';\n\n        return '1';\n    }\n\n    function populateAvitFields(avitGr, sourceName, appReleaseSysId, vulnEntrySysId, fields) {\n        avitGr.application_release = appReleaseSysId;\n        avitGr.vulnerability = vulnEntrySysId;\n        avitGr.source = sourceName;\n\n        if (fields.sourceAvitId && avitGr.isValidField('source_avit_id'))\n            avitGr.source_avit_id = fields.sourceAvitId;\n\n        if (fields.sourceSeverity && avitGr.isValidField('source_severity'))\n            avitGr.source_severity = fields.sourceSeverity;\n\n        if (fields.scanType && avitGr.isValidField('scan_type'))\n            avitGr.scan_type = fields.scanType;\n\n        if (fields.location && avitGr.isValidField('location'))\n            avitGr.location = fields.location;\n\n        if (fields.sourceLink && avitGr.isValidField('source_link'))\n            avitGr.source_link = fields.sourceLink;\n\n        if (fields.summary) {\n            if (avitGr.isValidField('summary'))\n                avitGr.summary = fields.summary;\n            else if (avitGr.isValidField('short_description'))\n                avitGr.short_description = fields.summary;\n        }\n\n        if (fields.sourceFindingStatus && avitGr.isValidField('source_remediation_status'))\n            avitGr.source_remediation_status = fields.sourceFindingStatus;\n\n        avitGr.state = resolveAvitState(fields.state, fields.sourceFindingStatus);\n\n        var first = parseDateParts(fields.firstFound);\n        if (first.dtTm) {\n            if (avitGr.isValidField('first_found_dt_tm'))\n                avitGr.first_found_dt_tm = first.dtTm;\n            if (avitGr.isValidField('first_found'))\n                avitGr.first_found = first.date;\n        }\n\n        var last = parseDateParts(fields.lastFound);\n        if (last.dtTm) {\n            if (avitGr.isValidField('last_found_dt_tm'))\n                avitGr.last_found_dt_tm = last.dtTm;\n            if (avitGr.isValidField('last_found'))\n                avitGr.last_found = last.date;\n        }\n\n        if (isSysId(fields.cmdbCi) && avitGr.isValidField('cmdb_ci'))\n            avitGr.cmdb_ci = fields.cmdbCi;\n    }\n\n    // --- Validate required fields ---\n    var sourceName = str(source.u_source) || DEFAULT_SOURCE;\n    var sourceAppId = str(source.u_source_application_id);\n    var vulnId = str(source.u_vulnerability_id);\n    var sourceAvitId = str(source.u_source_avit_id);\n\n    if (!sourceAppId) {\n        ignore = true;\n        log.error('Missing u_source_application_id');\n        return;\n    }\n    if (!vulnId) {\n        ignore = true;\n        log.error('Missing u_vulnerability_id');\n        return;\n    }\n    if (!sourceAvitId) {\n        ignore = true;\n        log.error('Missing u_source_avit_id');\n        return;\n    }\n\n    var appName = str(source.u_application_name);\n    var appDesc = str(source.u_application_description);\n    var cmdbCi = str(source.u_cmdb_ci);\n    var businessAppInput = str(source.u_business_application) || appName;\n    var businessAppSysId = resolveBusinessAppSysId(businessAppInput);\n\n    if (isSysId(cmdbCi) && !businessAppSysId)\n        businessAppSysId = cmdbCi;\n\n    // --- 1) Upsert Discovered Application ---\n    var appReleaseSysId = upsertAppRelease(\n        sourceName,\n        sourceAppId,\n        appName,\n        appDesc,\n        cmdbCi,\n        businessAppSysId,\n        log\n    );\n    if (!isSysId(appReleaseSysId)) {\n        ignore = true;\n        return;\n    }\n\n    // --- 2) Upsert Application Vulnerability Entry ---\n    var vulnEntrySysId = upsertAppVulEntry(\n        sourceName,\n        vulnId,\n        str(source.u_vulnerability_name),\n        str(source.u_vulnerability_summary),\n        str(source.u_source_severity),\n        str(source.u_primary_cwe),\n        log\n    );\n    if (!isSysId(vulnEntrySysId)) {\n        ignore = true;\n        return;\n    }\n\n    var avitFields = {\n        sourceAvitId: sourceAvitId,\n        sourceSeverity: str(source.u_source_severity),\n        scanType: str(source.u_scan_type),\n        location: str(source.u_location),\n        sourceLink: str(source.u_source_link),\n        summary: str(source.u_vulnerability_summary) || str(source.u_vulnerability_name),\n        sourceFindingStatus: str(source.u_source_finding_status),\n        state: str(source.u_state),\n        firstFound: str(source.u_first_found_dt),\n        lastFound: str(source.u_last_found_dt),\n        cmdbCi: isSysId(cmdbCi) ? cmdbCi : businessAppSysId\n    };\n\n    // --- 3) Upsert AVIT ---\n    var avit = new GlideRecord(AVIT_TABLE);\n    avit.addQuery('application_release', appReleaseSysId);\n    avit.addQuery('vulnerability', vulnEntrySysId);\n    avit.addQuery('source_avit_id', sourceAvitId);\n    avit.orderByDesc('sys_updated_on');\n    avit.setLimit(1);\n    avit.query();\n\n    if (avit.next()) {\n        populateAvitFields(avit, sourceName, appReleaseSysId, vulnEntrySysId, avitFields);\n        avit.update();\n        log.info('Updated AVIT: ' + avit.getValue('number') + ' sys_id=' + avit.getValue('sys_id'));\n        ignore = true;\n        return;\n    }\n\n    // --- 4) New AVIT — populate target for transform map insert ---\n    populateAvitFields(target, sourceName, appReleaseSysId, vulnEntrySysId, avitFields);\n\n})(source, map, log, target);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expected behavior:"]}," Updates to existing AVITs show staging row state ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Ignored"]}," (the script updated records via GlideRecord). New AVITs may show ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Inserted"]}," on the staging row. Verify success on the AVIT, app release, vulnerability entry, and Import Log—not only the staging row state."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"field-name-note--source_app_id-","__idx":14},"children":["Field name note (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source_app_id"]},")"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The script writes ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source_app_id"]}]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sn_vul_app_release"]},". The UI label may read ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source application ID"]},". Confirm the element name on your instance:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"sys_dictionary.list → name = sn_vul_app_release → element contains source\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your instance uses ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source_application_id"]}]}," instead, replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source_app_id"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source_application_id"]}," in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["upsertAppRelease"]}," (query + setValue)."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"5-configure-normalized-severity-map","__idx":15},"children":["5. Configure Normalized Severity Map"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["All > Application Vulnerability Response > Administration > Normalized Severity Maps"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]}," (or duplicate an existing scanner map)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source"]}," to match the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source"]}," values Synqly sends (default ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Synqly AVR"]}]},"). If staging rows omit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source"]},", the transform script falls back to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AVR Integration"]}]},"—configure a map for whichever source name your rows use."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Map severity values, for example:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Source severity"},"children":["Source severity"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Normalized"},"children":["Normalized"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Critical / 5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1 - Critical"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["High / 4"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2 - High"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Medium / 3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3 - Medium"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Low / 2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4 - Low"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Informational / 1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5 - None"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Adjust mappings to match the OCSF finding severity values your integration sends in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_severity"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting","__idx":16},"children":["Troubleshooting"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Symptom"},"children":["Symptom"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Likely cause"},"children":["Likely cause"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["401"]}," on import POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API key path:"]}," missing Import Set REST API Access Policy — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/provider-configuration/appsec-servicenow-setup#appsec-sn-token-step-6-import-set-policy"},"children":["step 6"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Basic auth:"]}," check integration user roles (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["import_transformer"]},", AVR write roles) and ACLs on import and AVR tables"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Empty staging rows after POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["REST Insert Multiple ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column Mapping"]}," uses ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Label"]}," instead of ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column name"]}," — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#31-column-mapping-related-list"},"children":["section 3.1"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing app release, vuln entry, or AVIT"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Required fields missing on staging row (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_application_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_vulnerability_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source_avit_id"]},"); check transform script log and Import Log"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Staging row state ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Ignored"]}," on update"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Expected when the script updates an existing AVIT via GlideRecord"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Severity not normalized"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Normalized Severity Map ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source"]}," does not match ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["u_source"]}," on staging rows (Synqly default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Synqly AVR"]},")"]}]}]}]}]}]},"headings":[{"value":"ServiceNow Application Vulnerability Findings Import Setup Guide","id":"servicenow-application-vulnerability-findings-import-setup-guide","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Upsert keys","id":"upsert-keys","depth":3},{"value":"1. Create staging table and columns","id":"1-create-staging-table-and-columns","depth":2},{"value":"1.1 Create the table","id":"11-create-the-table","depth":3},{"value":"1.2 Add columns","id":"12-add-columns","depth":3},{"value":"2. Create data source","id":"2-create-data-source","depth":2},{"value":"3. Configure REST Insert Multiple (required for batch API)","id":"3-configure-rest-insert-multiple-required-for-batch-api","depth":2},{"value":"3.1 Column mapping (related list)","id":"31-column-mapping-related-list","depth":3},{"value":"4. Create transform map (no Field Maps)","id":"4-create-transform-map-no-field-maps","depth":2},{"value":"4.1 Create the map","id":"41-create-the-map","depth":3},{"value":"4.2 Do not add Field Maps","id":"42-do-not-add-field-maps","depth":3},{"value":"4.3 Add onBefore transform script","id":"43-add-onbefore-transform-script","depth":3},{"value":"onBefore script","id":"onbefore-script","depth":4},{"value":"Field name note ( source_app_id )","id":"field-name-note--source_app_id-","depth":3},{"value":"5. Configure Normalized Severity Map","id":"5-configure-normalized-severity-map","depth":2},{"value":"Troubleshooting","id":"troubleshooting","depth":2}],"frontmatter":{"slug":"guides/provider-configuration/appsec-servicenow-findings-import-setup","seo":{"title":"ServiceNow Application Vulnerability Findings Import Setup Guide"}},"lastModified":"2026-07-21T14:51:56.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/provider-configuration/appsec-servicenow-findings-import-setup","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}