Once all the Tasks are closed, RITM and request wil close automatically

SNOW46
Tera Contributor

Hi All,

I want to configure one script for Service Catalog. When all the Tasks are closed, then corresponding RITM as well as Request will get closed automatically.

Incase of any RITM if there is only single task then once the TASK is closed, then RITM State will be updated to Closed Complete as well as Request will also gets closed.

On the another hand, incase of any RITM if there are any multiple TASK generated, then till all the TASK are not closed the RITM state will not change to Closed Complete or get closed.

After all the TASK are closed, the RITM as well as Request will also get Closed.

 

Can anyone let me know how to achieve this requirement.

 

Thanks,

SNOW@Das

18 REPLIES 18

It is checking if there is any task related to ritm active.

If any is still active it will not close ritm.

If there is one or four tasks it doesn't matter. 

Hi Slawek,

In the condition current.state.changes() && current.state==6, the value you have mentioned current.state==6 I am having some doubt. the value 6 is which state value can you please let me know on the same?

 

 

Thanks,

SNOW@Das

State = 6 is Closed Complete but you have to check this in your instance. 

Actually just now I tried with two tasks it is not working for me.

So State = 6 is the value for Task,RITM or Request?

Please kindly guide me.

And actually before I tried one script which was defined by someone earlier but it is disabled now but still the RITM and Request how it is getting closed.

 

find_real_file.png

find_real_file.png

 

Now I have configured your script. But before that script which was disabled now but still the RITM as well as Requests are getting closed. I even don't find any Globally Defined.

 

Please kindly help me out on the same.

 

Thanks,

SNOW@Das

As I said we are adding Rule to sc_task table so state we use is task state. 

You add Rule for Update only not insert.