RITM and SCTASKS State

sravya vemula
Tera Contributor

I am working on a catalog item where the requirement is to create two parallel sctasks. If one of the task is set to closed incomplete, then another sctask and also the ritm state is being changed to closed incomplete. Thus the ritm stage is set to request cancelled. 

But the reqs is to wait for the second sctask to get over and RITM state should be set as per the below conditions.

Both sctasks - Closed complete = Ritm - closed complete

One sctask closed incomplete/skipped and one sctask is closed complete = Ritm - closed complete

Both sctasks closed incomplete/skipped = Ritm - closed incomplete.

 

Need advise on how this can be accomplished.

4 REPLIES 4

ROhit Pasumarth
Tera Contributor

Hi Sravya,

 

You can achieve this by modifying corresponding workflow 

Create one JOIN and add both sctask to that then add that JOIN to  Run script activity .

 

In that Run script GLIDE SCTASK and query current RITM and if condition check for Sctask state, according to that update RITM state

 

 

 

 

 

Roshan Tiwari
Tera Guru

Hi @sravya vemula ,

 

If you want to make the solution for all request and catalog task, then create a BR and call script include to achieve this by addition logical conditions. 

 

If only for single request then use workflow, it is best option to di that. Create task parallel and wait for both task to get closed and add join (it will help to wait when all flows are met) and run the script.

Kamil Smusz
Kilo Sage

hi,

 

Flow designer will be the best option for that. In Create catalog task there is wait checkbox and if you select it flow will be waiting till sctask is not closed

psnow123
Giga Guru

Wait, uses Active to decide when to continue the flow, and it isn't going to check the state of the other tasks, and there may be a variable number of tasks. https://docs.servicenow.com/bundle/utah-build-workflows/page/administer/flow-designer/reference/crea...

 

Basically, you're trying to set the Request state when all Tasks are complete/incomplete.

 

I would consider something like:

 

-Trigger on SC_Task update

-Use the relationship from Task to Request, to find the other Task

-Check Task 2 against your logic (if task 1 AND task 2 = something then set Request state)