How to populate parent incident creation date on detection field in the incident form.

ashok17
Tera Contributor

How to populate parent incident creation date on 'detection field' in the incident form in the servicenow

 

I have tried below script on Business Rule but did not works for me. Please suggest achieve on this requirement.

 

(function executeRule(current, previous /*null when async*/ ) {
    if (current.parent_incident) {
        var parent = new GlideRecord('incident');
        if (parent.get(current.parent_incident)) {
            current.u_detection_time = parent.sys_created_on;
        }
    }
})(current, previous);
1 ACCEPTED SOLUTION

Tanushree Maiti
Kilo Patron

Hi @ashok17 

 

Try with getReference() method so that you can dot walk.

 

function onLoad() {   

 if (g_form.getValue('parent'))

{        

var parent = g_form.getReference('parent', function(parent) {

           g_form.setValue('u_detection_time', parent.sys_created_on);              

 });

   }

}

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

View solution in original post

5 REPLIES 5

Hi @ashok17 

If you've got your solution, Accept the solution and close this thread, please.

 

 

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: