when an incident is resolved by fixed by change . Change number is not showing up in fixed by change field.

prash4
Tera Expert

when an incident is resolved by fixed by change . Change number is not showing up in fixed by change field. 

 

find_real_file.png

16 REPLIES 16

hello update your br to below script

i hope your br is on change request form and i have added one line to update fixed by change 

gr.your_fixed_by_change_field_backend_name=current.sys_id;

 

function executeRule(current, previous /*null when async*/ ) {
    gs.log('abc' + current.sys_id);
    var gr = new GlideRecord("incident");
    gr.addQuery("rfc", current.sys_id);
    //gr.addQuery("state", 4); // incident state 4 is pending change
    gr.query();
    while (gr.next()) {
        gs.log('abc 123' + gr.number);
        // resolve the incident
        gr.state = 6; // OOB, resolved is 6
gr.your_fixed_by_change_field_backend_name=current.sys_id;
        // add some canned comments to the resolved incident
        //gr.description = "This incident has been resolved due to the successful implementation of change request " + current.number;
       // gr.rfc = current.short_description;
        gr.update();
    }

})(current, previous);

PLEASE MARK MY ANSWER CORRECT IF THIS HELPS YOU

Hi @Mohith Devatte 

I tried using the line you have given still not working change number in fixed by change field is not showing up.

this is an example of my pdi snip. this is how it has to work.

find_real_file.png

hello , what is your BR trigger condition and on which table it is configured ?

 

this is the BR!!

 

find_real_file.png

make sure "rfc" is the field which is storing the change request and you have used the correct back end name of the field  in the below line?

    gr.addQuery("rfc", current.sys_id);

Also is the state of incident getting update to resolved ?

please post your script once