How cancel RITM if SCTASK is closed incomplete using flow designer?

Ash41
Kilo Sage

Hi Team, 

 

I'm able to close the RITM when SCTASK is "closed complete". But, at the sametime if SCTASK is "closed incomplete" how to make RITM state "cancelled" using flow designer?

 

find_real_file.png

Regards, 

Ash

1 ACCEPTED SOLUTION

Hi,

then do this in the BR

Condition: State Changes to Closed Incomplete

Script:

(function executeRule(current, previous /*null when async*/) {

    // Add your code here

var ritm = current.request_item.getRefRecord()'

ritm.state = 'cancelled';

ritm.update();

})(current, previous);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Hi,

No

The above script will set RITM as Closed Complete when all the sc tasks for that RITM are completed i.e. task marked closed complete, closed incomplete, close cancelled

What is exactly required?

1) Usually we close RITM once all sc_tasks are closed whatever be the state of sc task

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, 

 

Sorry, If my question was not correct!

I was able to do RITM "completed" when SCTASK is "closed completed" using flow designer as I mentioned before. but, If SCTASK is "closed Incomplete" then RITM needs to be updated as "Cancelled" this is not happening. can you please suggest for that?

 

Regards,

Ash

Hi,

then do this in the BR

Condition: State Changes to Closed Incomplete

Script:

(function executeRule(current, previous /*null when async*/) {

    // Add your code here

var ritm = current.request_item.getRefRecord()'

ritm.state = 'cancelled';

ritm.update();

})(current, previous);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you so much, Ankur!

 

Let me try this.

Regards, 

Ash