---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ReportCiStatusOutputJS - Scoped

# ReportCiStatusOutputJS - Scoped {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

The ReportCiStatusOutputJS API provides methods that return specific object properties for the DiscoveryAPI reportCiIpAddressStatus method and then converts the information into a JSON
string.

This class runs is in the `sn_discovery` namespace.

## ReportCiStatusOutputJS - getCiOperationStatus() {#ariaid-title2}

Returns the state of the scanned CI.
This is a calculated field based on the last_state field in discovery_device_history table
and the state field in the discovery_status table.
{#r_RepCiStatOutgetCiOperationStatus__table_s4x_hfb_scb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#r_RepCiStatOutgetCiOperationStatus__table_s4x_hfb_scb} {#r_RepCiStatOutgetCiOperationStatus__table_t4x_hfb_scb__entry__2}

| Type | Description |
|-|-|
| string | The three possible states returned by this method are: * Processing: Discovery is still processing the request. * Successful: A CI was created or updated. * NotSuccessful: A CI was not created or updated, and the Discovery status was Completed or Cancelled. {#r_RepCiStatOutgetCiOperationStatus__ul_kll_ngb_scb} |
[Table 2. Returns]

{#r_RepCiStatOutgetCiOperationStatus__table_t4x_hfb_scb}  

    var ipResultObj = sn_discovery.DiscoveryAPI.reportCiIpAddressStatus(ipAddress, discoveryStatus);
    gs.info("ipResultObj(CiOperationStatus): " + ipResultObj.getCiOperationStatus());

## ReportCiStatusOutputJS - getCmdbCI() {#ariaid-title3}

Returns the value in the cmdb_ci field from the discovery_device_history table for the CI being scanned.
{#r_RepCiStatOutgetCmdbCI__table_xxp_jsz_rcb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#r_RepCiStatOutgetCmdbCI__table_xxp_jsz_rcb} {#r_RepCiStatOutgetCmdbCI__table_yxp_jsz_rcb__entry__2}

| Type | Description |
|-|-|
| string | Sys_id of the CI created or updated. This value can be null in the case of intermediate results before a CI is created. |
[Table 4. Returns]

{#r_RepCiStatOutgetCmdbCI__table_yxp_jsz_rcb}  

    var ipResultObj = sn_discovery.DiscoveryAPI.reportCiIpAddressStatus(ipAddress, discoveryStatus);
    gs.info("ipResultObj(cmdb): " + ipResultObj.getCmdbCI());

## ReportCiStatusOutputJS - getDiscoveryState() {#ariaid-title4}

Returns the value from the State field in the Discovery Status \[discovery_status\] table.
The values returned by this method are used to calculate the value returned by the [getCiOperationStatus()](https://servicenow-prod.fluidtopics.net/~m2~eMVZ8fRSrCqY5NcbVw#r_RepCiStatOutgetCiOperationStatus "Returns the state of the scanned CI.") method
{#r_RepCiStatOutgetDiscoveryState__table_ntv_blb_scb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 5. Parameters]

{#r_RepCiStatOutgetDiscoveryState__table_ntv_blb_scb} {#r_RepCiStatOutgetDiscoveryState__table_otv_blb_scb__entry__2}

| Type | Description |
|-|-|
| string | The possible states returned by this method are: * Starting * Active * Complete * Cancelled {#r_RepCiStatOutgetDiscoveryState__ul_kll_ngb_scb} |
[Table 6. Returns]

{#r_RepCiStatOutgetDiscoveryState__table_otv_blb_scb}  

    var ipResultObj = sn_discovery.DiscoveryAPI.reportCiIpAddressStatus(ipAddress, discoveryStatus);
    gs.info("ipResultObj(discoveryState): " + ipResultObj.getDiscoveryState());

## ReportCiStatusOutputJS - getIpAddress() {#ariaid-title5}

Returns the value from the source field in the discovery_device_history table for the CI being scanned.
{#r_RepCiStatOutgetIpAddress__table_vjx_mmb_scb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 7. Parameters]

{#r_RepCiStatOutgetIpAddress__table_vjx_mmb_scb} {#r_RepCiStatOutgetIpAddress__table_wjx_mmb_scb__entry__2}

| Type | Description |
|-|-|
| string | The IP address of the CI being scanned. |
[Table 8. Returns]

{#r_RepCiStatOutgetIpAddress__table_wjx_mmb_scb}  

    var ipResultObj = sn_discovery.DiscoveryAPI.reportCiIpAddressStatus(ipAddress, discoveryStatus);
    gs.info("ipResultObj(IpAddress): " + ipResultObj.getIpAddress());

## ReportCiStatusOutputJS - getIssues() {#ariaid-title6}

Returns the value from the issues field in the discovery_device_history table for the CI being scanned.
{#r_RepCiStatOutgetIssues__table_wk3_3pb_scb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 9. Parameters]

{#r_RepCiStatOutgetIssues__table_wk3_3pb_scb} {#r_RepCiStatOutgetIssues__table_xk3_3pb_scb__entry__2}

| Type | Description |
|-|-|
| integer | Number of issues in this Discovery for this CI. |
[Table 10. Returns]

{#r_RepCiStatOutgetIssues__table_xk3_3pb_scb}  

    var ipResultObj = sn_discovery.DiscoveryAPI.reportCiIpAddressStatus(ipAddress, discoveryStatus);
    gs.info("ipResultObj(issues): " + ipResultObj.getIssues());

## ReportCiStatusOutputJS - getIssuesLink() {#ariaid-title7}

Returns the value from the issues_link field in the discovery_device_history table for the CI being scanned.
{#r_RepCiStatOutgetIssuesLink__table_elk_m5b_scb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 11. Parameters]

{#r_RepCiStatOutgetIssuesLink__table_elk_m5b_scb} {#r_RepCiStatOutgetIssuesLink__table_flk_m5b_scb__entry__2}

| Type | Description |
|-|-|
| string | The issues_link field from the discovery_device_history table. This value may be null or an anchor tag defining a hyperlink to a page that provides the list of issues associated with the Discovery Status and CI (IP address). |
[Table 12. Returns]

{#r_RepCiStatOutgetIssuesLink__table_flk_m5b_scb}  

    var ipResultObj = sn_discovery.DiscoveryAPI.reportCiIpAddressStatus(ipAddress, discoveryStatus);
    gs.info("ipResultObj(issues_link): " + ipResultObj.getIssuesLink());

## ReportCiStatusOutputJS - toJson() {#ariaid-title8}

Serializes the ReportCiStatusOutputJS object.
This method throws the IllegalArgumentException exception,
`Cannot serialize object, e` when the method is unable to serialize the
object. The e is the exception object, which provides the exception
message and trace.
{#r_RepCiStatOuttoJson__table_ad5_xyb_scb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 13. Parameters]

{#r_RepCiStatOuttoJson__table_ad5_xyb_scb} {#r_RepCiStatOuttoJson__table_bd5_xyb_scb__entry__2}

| Type | Description |
|-|-|
| string | Serialized instance of the ReportCiStatusOutputJS object into a JSON string. |
[Table 14. Returns]

{#r_RepCiStatOuttoJson__table_bd5_xyb_scb}  

    var ipResultObj = sn_discovery.DiscoveryAPI.reportCiIpAddressStatus(ipAddress, discoveryStatus);
    gs.info("ipResultObj(json): " + ipResultObj.toJson());


