ATF custom test step remains in pending state while execution

Divya90
Tera Contributor

I have created a custom step configuration to update a value in the record but it remains in pending state during execution. Could someone help me out from this situation.

Refer below script -

function executeStep(inputs, outputs, stepResult, timeout) {
 
var gr = new GlideRecord('x_cpts_onboarding_cpts_onboarding_task');   
    gr.addQuery('sys_id',  inputs.u_task_record);
    gr.query();
 
    if (gr.next()) {
        var date = gr.sys_created_on;
        var gdt = new GlideDateTime(date);
        var dt = gdt.getDisplayValue().split(' ')[0];
        gr.cnd = dt;
        gr.update();
        stepResult.setOutputMessage('Success!');
        stepResult.setSuccess();
}
stepResult.setOutputMessage('Failure!');
stepResult.setFailed();
 
}(inputs, outputs, stepResult, timeout);
 
input variable -
Divya90_0-1696506367769.png

 

After execution -

Divya90_1-1696506550743.png

 

 

 

4 REPLIES 4

Shaqeel
Mega Sage

Hi @Divya90 

 

Can you share the screenshot of the form and what need to be updated?

Have you tried some other approach? 

 

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

Divya90
Tera Contributor

Divya90_0-1696507203560.png

I am updating this Credit Notification Date field and didn't tried for other approach.

 

Hi @Divya90 

 

Why are you doing it complex way?

 

Simply use Set field value step and for dynamic date use 
javascript: gs.daysAgo(-7)

 

Please mark is solution/helpful.

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

Pooja_32
Tera Contributor

i got the same error for custom step  pending at the time of execution