Which is the script that close open project tasks when the Project is set to Close Complete/Incomplete/Skipped?

edo88
Giga Contributor

Which is the script that close open project tasks when the Project is set to Close Complete/Incomplete/Skipped?

Basically after this message is displayed (triggered by the Save action), what happens?

 

find_real_file.png

 

Many thanks!

1 ACCEPTED SOLUTION

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

What that does is close all associated project tasks and sub-task that are not closed out. 

This is from the Business Rule "Process State Change" on pm_project table

View solution in original post

9 REPLIES 9

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

What that does is close all associated project tasks and sub-task that are not closed out. 

This is from the Business Rule "Process State Change" on pm_project table

Yes correct. which triggers script include "PlannedTaskStateChangeHandler".

 

thanks!

@Miguel Donayre I know this is an old post, but this is in my instance but won't close the tasks. Any ideas on where to look as to why it wont? We do have a custom state "pause" for pending approvals. Any guidance is helpful though. I just need the tasks to also auto-close when the approvals are accepted. Right now the state of the project closes, but the project tasks are being reset to pending instead of closing out (in Paris)

Hello,

You mentioned you created some custom state for Project, which is ok. I am not going to point fingers at you and say how bad that is. 

What seems to be happening is that the 'Process State Change' business rule is running into issues because the states of the project and project tasks are not defined correctly into 'pending', 'open', 'work in progress' and 'closed' states so when we close the parent project this business rule goes to the project tasks and will close them as well however the state values don't match and that results in the tasks to be set to pending (the default value). Both the Project and Project task use the Planned Task Dictionary Override for State. 

Part of this process is defined on the dictionary overrides for the state field of the task record. You would need to create one for the Project task table and/or the Project table as it does not have one out of the box a

Here is the documentation that explains how to modify or create a new 

https://docs.servicenow.com/bundle/quebec-it-business-management/page/product/project-management/tas...

 

This might not work either, but my first troubleshooting step would be to look into this. I hope that points you in the right direction! 

 

Thank you - and yes I am aware this is not a good idea however management wants this.