Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

GRC Issue form Mapping from a CIM record.

anuragsnow
Tera Contributor

I am moving data from a CIM (Continuous Monitoring) record to an Issue record, but stuck on how to map the attachment and some fields like assigned to.

 

Please help me with this issue, I appreciate your quick response thank you

 

Thanks,

Anurag Chaudhary

1 REPLY 1

Vinod Laxmeshwa
ServiceNow Employee

@anuragsnow : 

 


Moving Data from a Continuous Monitoring Record to an Issue Record — Attachments & Field Mapping

Happy to help point you in the right direction on this. Here are two approaches worth exploring, though I'd recommend validating the table names and field configurations on your specific instance before implementing.


Copying Attachments

ServiceNow stores attachments in the sys_attachment table, linked to their parent record via table_sys_id. The key thing many miss is that the Copy Attachment action in Flow Designer requires the source to be an sys_attachment record — not the parent CIM record itself.

Flow Designer approach:

  1. Look Up Records on sys_attachment where table_sys_id = your CIM record sys_id
  2. Add a For Each loop
  3. Inside the loop, use the OOTB Copy Attachment action pointing to your Issue record

Script approach:

// Always insert the Issue record first before copying attachments
var issueSysId = issueGR.insert();
GlideSysAttachment.copy('your_cim_table', cimRecord.sys_id, 'sn_grc_issue', issueSysId);

Important: The target Issue record must be inserted before calling GlideSysAttachment.copy(). Calling copy on an uninserted record will silently fail.


Mapping Reference Fields like Assigned To

For reference fields, always use getValue() to retrieve the sys_id — not .toString(), which returns the display value and will break the mapping.

issueGR.setValue('assigned_to', cimRecord.getValue('assigned_to'));

Before you implement — verify these on your instance:

  • CIM table name — confirm the exact table name via sys_db_object. Continuous Monitoring tables can vary depending on your P&CM configuration
  • Issue table namesn_grc_issue is the standard, but confirm on your instance
  • Assigned To field — not all CIM record types carry an assigned_to field natively. Check the CIM table schema first

Hope this helps get you unblocked. If this does not work, I recommend to raise a support case.