Issues with close of RITM's and Catalog Tasks

Vaishnavi35
Tera Guru

Hi,

1. When Tasks are closed, RITM is not getting closed. (RITM should close once the Catalog Task is closed)
2. When RITM is cancelled/closed Tasks should cancel or close . Approvals No longer required.

Vaishnavi35_0-1687518970924.png

Code does not work. The Tasks are getting closed just fine but the RITM state automatically moves to "Closed Incomplete" though I am marking it as Closed Complete , once the form reloads it moving to closed incomplete. Not sure why.

3. Once the RITM is closed REQ is not getting closed and still "Active".

 

Please help me fix this issue!

 

Thanks,

Vaishnavi

1 ACCEPTED SOLUTION

This happening because your workflow is attached to the RITM and it is still going to proceed with the flow. There is only one functionality which cancel the workflow upon ritm cancelation. 

If you close complete the RITM and there is still few activities in the workflow to be executed. it will execute that. 

 

Make sure to close RITM upon completion of Workflow. you can do one thing before this activity. You can put a if statement and check if RITM is closed complete or not and according proceed the flow.

 

Please mark it Correct if it resolves your query.

View solution in original post

24 REPLIES 24

Mehta
Kilo Sage
Kilo Sage

You need to configure these things in the workflow that is being attached to a particular Item.

Depending on your flow you can use run script activity just before end activity and use below script to close RITM and Request. 

var state = '';
var catTask = new GlideRecord('sc_task');
catTask.addQuery('request_item', current.sys_id);
catTask.query();
while (catTask.next()) {
    state = catTask.state;
}
current.state = state;

var request = new GlideRecord('sc_request');
request.addQuery('sys_id',current.request);
request.query();
if (request.next()) {
    request.state = state;
    request.update();
}

 

Can you please marked it as correct answer or helpful. If it solved your query. 

@Vaishnavi35 

 

WERE YOU ABLE TO RESOLVE IT, 

 

Can you please marked it as correct answer or helpful. If it solved your query. 

Hi ,

 

I moved the RITM state to "Closed Incomplete" , the Task state moved to "Work In Progress".

Vaishnavi35_0-1686227528892.png

 

 

Thanks,

Vaishnavi

@Vaishnavi35 

 

please check if the below highlighted business rule as it is oob business rule which close task on cancellation of ritm. further more please make sure you are creating catalog task and not task through workflows. 

As i can see the above screenshot has TASK instead of SCTASK, as per best practice make sure you are choosing sctask table in create task activity. this is because multiple oob business rule on ritm do glide record sctask and not task. 

 

Mehta_0-1686228073076.png