Script that updates all resource plans costs for a project.Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Use case: Customer is planning to to apply new rate model to all 900+ projects and their resource plans.Q1. Is there a script we can provide them customer to apply the new rate lines to all or large subset existing projects/resource plans?Q2. Given how long it takes for one resource plan, is this even recommended? I have inform customer that it will take a lot of time to recalculate larges subsets.Additionally, it is better to check one at a time to make sure everything is correct. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } N/A Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Test the script provided by the product team in a lower environment.2. Create a scheduled job with the given script and schedule the script execution during down/maintenance time.3. Select one project and call recalculateResourceCost("project", "selected_project_id", "project_start_date/some_start_date", "project_end_date/some_end_date", "true", "true", "true") using the above script in the background script to check if it is working.4. Once it is working properly, create a scheduled job to run the above-given script during the instance's downtime.5. Run the job initially on a cloned/dev instance, and after thorough, successful validation, run the job on the prod instance. Below is the script:*********************** script starts here ***********************function recalculateResourceCost(entityType, entityId, startDate, endDate, plannedCostForRequestedPlans, allocatedCostForAllocatedPlans, requestedCostForAllocatedPlans) {if(entityType == 'project') {var states = [];var TaskUtils = new TaskResourcePlansUtil();if((JSUtil.notNil(plannedCostForRequestedPlans) && plannedCostForRequestedPlans == "true"))states = states.concat([ResourcePlanState.PLANNING, ResourcePlanState.REQUESTED]);if(JSUtil.notNil(allocatedCostForAllocatedPlans) && allocatedCostForAllocatedPlans == "true")states = states.concat([ResourcePlanState.CONFIRMED, ResourcePlanState.ALLOCATED]);TaskUtils.recalculateResourcePlanCost(entityId, plannedCostForRequestedPlans, allocatedCostForAllocatedPlans, requestedCostForAllocatedPlans, startDate, endDate, states);}}var gr = new GlideRecord("pm_project");gr.addQuery("rate_model=daf6052adb5823009ef63a2b7c961942"); //Change the condition to filter the projects based on your criteriagr.query();while (gr.next()) {var _startDate = gr.getValue("start_date"); //Can be hardcoded, if they have a certain start date in mind.var _endDate = gr.getValue("end_date"); //Can be hardcoded, if they have a certain end date in mind.recalculateResourceCost('project', gr.getValue("sys_id"), _startDate, _endDate, "true", "true", "true");}*********************** script starts here ***********************