- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
I'm spending significant time researching easier ways to migrate projects from other systems into ServiceNow. Usually a fundamental difference in how constraints, schedules, and/or predecessor & successor relationships are handled causes schedule "shift" after migration.
With SN's MSProject importer, projects are imported clean, but set to Manual calculation. Switching to Automatic can cause significant schedule shift (usually because "START ASAP" constraint type works). So how can we best prepare a PMO to import projects, keep them *automatic*, and make them precisely aware of what WBS components need repair? Baselining!
Problem? Any more than a handful of projects, and Baselining is going to be really labor intensive.
BASELINE BY SCRIPT INSTEAD
I deconstructed the Create Baseline UI Action for a script that allows you to baseline many Projects at once. For now, this is just a background or a repair script. In the future I'll make it a more fully fleshed out List Bottom Button UI Action.
//FILTER LIST OF PROJECTS YOU WANT BASELINED
//COPY & PASTE THE ENCODED QUERY INTO THE QRY VARIABLE
var qry = ''; //MUCHOS IMPORTANTE! PASTE ENCODED QUERY HERE
createBaselines(qry);
function createBaselines(query_set) {
baseline_name = "List Baseline - " + gs.nowDateTime();
baseline_description = "Multi project baseline taken on " + gs.nowDateTime() + " by " + gs.getUser().getDisplayName();;
//Get TopTasks
var topTask = new GlideRecord('pm_project');
topTask.addEncodedQuery(query_set);
topTask.query();
var counter = 0;
while (topTask.next()){
counter+=1;
createProjectBaseline(baseline_name, baseline_description, topTask.sys_id);
}
}
function createProjectBaseline(name, description, project){
var baseline = new GlideRecord("planned_task_baseline");
baseline.name = name;
baseline.description = description;
baseline.top_task = project;
var baseID = baseline.insert();
baselineProjectTasks(project,baseID);
gs.addInfoMessage(gs.getMessage("Created baseline for " + project);
}
function baselineProjectTasks(task_id, target_baseline){
var tasks = new GlideRecord("planned_task");
tasks.addQuery("top_task", task_id);
tasks.query();
pcounter = 0;
while (tasks.next()) {
pcounter+=1;
var baseItem = new GlideRecord("planned_task_baseline_item");
baseItem.baseline = target_baseline;
baseItem.task = tasks.getUniqueValue();
baseItem.start = tasks.start_date;
baseItem.end = tasks.end_date;
baseItem.insert();
}
}
Walkthrough
- You paste in an encoded query of projects you wish to baseline. I don't assume project migrations are de-facto only projects on system.
- createBaselines sets the naming/description parameters for all the baselines, then gets all the Projects from your encoded query
- for each Project in your query, the createProjectBaseline function is run
- createProjectBaselines creates the actual Baseline records from the provided name/description and laucnhes baselineProjectTasks
- baselineProjectTasks finds all planned_tasks associated with the provided project and creates planned_task_baseline_items
- once baselineProjectTasks is complete, createProjectBaselines adds an info message that the currently iterated project is baselined.
- 743 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.