Midilesh
Tera Contributor

Hi Folks,

I have recently implemented ATF on change forms where I came across a barrier Risk Assessment .I had gone through the below approach to bypass Risk Assessment on change forms.

Role: Admin 

 

Step1: Impersonate as an admin user.

Step2: Insert a record into change_request table . Fill out the necessary mandatory fields and set the state after the Risk Assessment step happens.

 

Note: By inserting the Record directly into the appropriate table risk assessment can be bypassed. Please go through the attachment Provided and let me know if any one needed assistance.

 

 

Regards,

Midilesh

Comments
Abby5
Tera Contributor

Hi @Midilesh I don't see an attachment. Do you mind attaching it again? Thank you!

Midilesh
Tera Contributor

Hi Abby,

Please go through the below steps:

find_real_file.png

Regards,

Midilesh.

Sandip1422
Tera Contributor

Thank you Midilesh, for the workaround. I was also facing the same issue, and by inserting the record directly into the change table, risk assessment can be bypassed.

Much appreciated!!

OMT
Giga Guru

But what when Risk Assesment mandatory is? 

saidinesh
Tera Expert

We can generate an assessment using a script by utilizing the Run server-side script and then inserting answer in the value column

    var gr = new GlideRecord("change_request");
    gr.get(steps("GIVE SUBMIT/RECORD QUERY STEP SYS ID HERE").record_id);
 
    new ChangeRiskAsmt().invokeAssessment({
        "tableName""change_request",
        "sysId": gr.sys_id,
        "userId": gs.getUserID(),
        "copyAsmt"false
    });

    var chga = new GlideRecord('asmt_assessment_instance_question');
    chga.addEncodedQuery("source_id=" + gr.sys_id);
    chga.query();
    while (chga.next()) {
        //INSERT YOUR IF ELSE CONDITIONS HERE TO SET THE VALUES
        chga.value = 1;
        chga.update();
    }
Wei_ Ling
Tera Guru

@saidinesh 

Hello saidnesh.

The method you give is very effective, but I want to ask, is there any code that can be directly submitted when running server script? Because now I click risk assessment again on the form and use the click component. If I click submit, the following error will be reported:

Wei_Ling_0-1706781281038.png

And I've put the error in Allowed client error, but there's still this error:

Wei_Ling_1-1706781341155.png

 

Version history
Last update:
‎06-20-2022 10:42 PM
Updated by: