Set percent_complete based on task completion

MBarrott
Mega Sage

I know OOTB ServiceNow currently has the percent_complete field to calculate based on the # of days completed within the project tasks. 

 

For me this isn't optimal and isn't an accurate reflection of a project completion percentage. 

 

It looks like the BR "Update Parent Percent Complete" is responsible for this data manipulation. 

 

Before I comment out this BR and script it myself, is there an easier solution so that this field calculates task percent completed based off of ((# of tasks completed / total tasks) * 100)?

2 REPLIES 2

jMarshal
Mega Sage
Mega Sage

I am not an expert with SPM by any means, but quite strong with SNC (core/platform) and it really seems like you are on the right track. I agree with your sentiment about actual reflection of completion being based on work done (completed tasks) rather than "planned days remaining" (we really don't need a visual indicator to know that June 15 is half way between June 1 and July 1 - 50% complete on June 15 if the schedule is a month, for instance).

There is a setting in Project and Task properties (com.snc.project.rollup_project_start_date) which suggests that you can choose to not rollup the dates, but I don't think that will affect the percent complete beyond perhaps disabling it or not synchronizing with the tasks (which is something you still want to do, just in a different way).

...but I didn't see anything in other SPM/Project properties (resource properties, agile/scrum, etc) that would suggest you can specify the method for calculating the value you are looking for.

The only things that I would point-out, that you may want to consider are:

> Triggering. I assume you're looking to update a different script/action/artefact which is calling that br...whats the trigger for that call? Will this custom script recalculate when new tasks are created that do not affect the dates? Be careful not to assume the platform will call your custom function at the right times just because you found the spot where it calls this one oob...you may want to comment out the call AND create a new custom BR to ensure it runs when you need it to (probably when a project task is created or the active status changes).

> There may be other functions that rely on the "percent complete" value to be based on days...this one is more of a "guess and test" type of thing, that you cannot plan for besides consulting with folks who ARE experts in SPM (not me LOL). Be aware that there may be other features that use the "percent complete" value to display rich information or support automation. For example consider a potential email notification that triggers at 90% complete and says "you have X days left to finish" (that may not be accurate now that you've changed "percent complete" to **mean something different** than it does OOB).

Sumanth16
Kilo Patron

Hi @MBarrott , 

 

Please refer below thread:

https://www.servicenow.com/community/spm-forum/project-percentage-calculation/m-p/1039431

 

Please hit like and mark my response as correct if that helps


Thanks & Regards,

Sumanth meda