Add reference of related record to comments? (Workflow)

Andrew_TND
Mega Sage
Mega Sage

Hello,

I've created a workflow which creates a problem when a task is completed and populates the new record with the variables.

Now, is there a way I can either amend this section or another method where I can add the new problem reference to the closed request item?

Thanks in advance!

task.business_service = current.variables.service_name.getValue(); //complete

task.cmdb_ci = current.variables.cmdb.getValue(); 
task.description = "Source: " + current.number + "\n" + "Impact: " + current.variables.impact.getDisplayValue();
task.short_description = current.variables.title; 
task.u_incident = current.variables.related_incident.getValue(); 
task.u_category = current.variables.category.getDisplayValue(); 
task.u_subcategory = current.variables.subcategory.getDisplayValue(); 
task.u_risk_id = current.variables.risk.getDisplayValue(); 
task.u_additional_risk_information = current.variables.additional_risk_info.getDisplayValue(); 
task.work_around = "Work around: " + current.variables.work_around.getDisplayValue() + "\n" + "Known work around: " + current.variables.known_work_around.getDisplayValue();

 

1 REPLY 1

Hemanth M1
Giga Sage
Giga Sage

Hi @Andrew_TND ,

 

Use parent field on the Problem to set RITM so that it will be referenced to closed RITM

ex: problemvar.parent =current.sys_id //

it would reflect here: 

HemanthM1_0-1697105503150.png

Makse sure you add higlighted related list on RITM

HemanthM1_1-1697105550190.png

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025