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
Tera 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 Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

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 Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti