"State" remains open when Request State is "Closed Complete"

Sysop
Tera Contributor

After the sctasks are closed the ritms are closed, once the ritms are closed the "Request state" is set to closed but the "State" still remains open and the ticket has a time stamp of when its closed.  Looking back a few months ago, this was not happening .  We have recently added more people that just me working on SN so it could have been a change one of them made.  Can someone please advise on the likely culprit that is causing this?

find_real_file.png

1 ACCEPTED SOLUTION

Strange, its almost like the BR is not active but you already confirmed it is. You may want to open a Now Support case.

View solution in original post

11 REPLIES 11

Brian Lancaster
Tera Sage

This is handled by the Mark Request Closed BR on the sc_request table.

https://<your instance Name>.service-now.com/nav_to.do?uri=sys_script.do?sys_id=40afa110c611228401d8643e2c2748cb

Make sure it is active and has not been changed.

Edit: I also noticed that short description and description are mandatory field that are not filled in. This should not affect a BR but it may be something else it look into.

Thank you for your reply. 

 

It doesn't look like that BR has ever been changed and is still operating OOB

 

find_real_file.png

Here is the script for it

 

if (current.request_state == "closed_complete" ||
    current.request_state == "closed_incomplete" ||
    current.request_state == 'closed_cancelled' ||
    current.request_state == 'closed_rejected' ||
    current.stage == "closed_complete" ||
    current.stage == "closed_incomplete" || current.stage == "closed_skipped") {

    current.active = false;

    if (current.closed_by.nil())
        current.closed_by = gs.getUserID();

    if (current.closed_at.nil())  {
        current.closed_at = gs.nowDateTime();
        current.business_duration = gs.calDateDiff(current.opened_at.getDisplayValue(),current.closed_at.getDisplayValue(),false);
        current.calendar_stc = gs.dateDiff(current.opened_at.getDisplayValue(),current.closed_at.getDisplayValue(),true);
    }
    // update the state with request_state or stage.
    if(current.state == 1) {
        var state = current.request_state.indexOf('closed') == 0 ? current.request_state : current.stage;
        switch(state + '') {
            case 'closed_complete':
                current.state = 3;
                break;
            case 'closed_skipped':
                current.state = 7;
                break;
            default :
                current.state = 4;
                break;
        }
    }
    
}

 

Here is my Dictionary entry for "State", so none of that has changed.

 

find_real_file.png

 

So yeah, I'm pretty stumped on this one.  Any other suggestions?

Can you verify the request_state field choices on the sc_request does not have numbers for it values?

Yes

 

find_real_file.png