The CreatorCon Call for Content is officially open! Get started here.

RITM not closed despite cancelled SCTASK

mathewirene
Tera Contributor

Hello,

There is a incident raised stating that the RITM was raised for a hardware category . That catalog item had a workflow of creating two SCTASKS. Here the issue one SCTASK got closed complete and later which created another sctask which was also closed skipped state. Even when both the SCTASKS are closed the RITM still is in open state. Hence user wants  to know why RITM is still active . How and where can i check this. How to troubleshoot this. Which all parameters should i check on this to investigate.

 

Thanks

 

9 REPLIES 9

Viraj Hudlikar
Tera Sage
Tera Sage

Hello @mathewirene 

 

The RITM is still open because its workflow or flow has not reached an end state. The closure of SCTASKS only triggers the next step in the workflow, but doesn't necessarily close the RITM. The most common reason for this is that the workflow or flow is either stuck, waiting for another condition, or simply doesn't have an activity to explicitly close the RITM.

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

@mathewirene

 

Thank you for marking my response as helpful! 😊

I hope your concern has been fully addressed. If it resolves your issue, please consider marking it as the accepted solution. This will ensure others in the community can benefit from the solution too.

As per new community feature you can mark multiple responses as correct.


Thanks & Regards
Viraj Hudlikar.

@Viraj Hudlikar  

 

Thankyou for your guidence.The issue can be associated with flow. But the problem is i need to find the root cause for the issue. When i checke previous requests raised under this catalog item , it works fine. How can i investigate the right cause of the issue here. Where all should i check it for?

 

Shashank_Jain
Kilo Sage

@mathewirene ,

You need to add the steps to close the RITM in the workflow being used.

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain

SunilKumar_P
Giga Sage

Hi @mathewirene You can create a After Update Business Rule on SCTASK with the below script, which will actually checkfor any active SCTASKs while closing any task. If there are no active tasks then the RITM will be closed.

    var ritmGR = new GlideRecord('sc_req_item');
    if (ritmGR.get(current.request_item)) {

        var scTaskGr = new GlideAggregate('sc_task');
        scTaskGr.addQuery('request_item', ritmGR.getUniqueValue());
        scTaskGr.addQuery('sys_id', '!=', current.getUniqueValue());
        scTaskGr.addActiveQuery();
        scTaskGr.addAggregate('COUNT');
        scTaskGr.query();

        var scTaskCount = 0;
        if (scTaskGr.next()) {
            scTaskCount = scTaskGr.getAggregate('COUNT');
        }

        if (scTaskCount == 0) {
            ritmGR.state = 3;
            ritmGR.update();
        }
    }