- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
I've made it my Q4 2018 mission to maximize project data migration between Project and ServiceNow. You may have seen my other threads on why this is difficult:
Start ASAP vs Specific Date on Project Import
The Case for Exposing "Import from MS Project"
Project Import Utility
Crash test my MSProject Import Idea
Its VERY difficult to import projects and convert them from Manual to Automatic without significant date drift. To reconcile I've developed a strategy that customers have responded positively to.
- Import Projects
- Baseline Projects
- Update all Projects to Automatic Processing (in the properties tab of every Project)
- Have PMs adjust their project timelines prior to go live.
PROBLEM?
The problem is "baseline" as a concept is something you do on *A* project. There exists no concept of "Baseline all THESE" projects. If you're like me, and you need to import 100+ projects prior to go live, that's a MASSIVE PAIN IN THE PITOOTER.
BASELINE MULTIPLE PROJECTS
I deconstructed the Baseline UI Action and UI Page to give you a script you can use to baseline a bunch of projects at once. In this way you can import a ton of projects, then query for Projects created after a certain date. Use that query as a means of creating a loop to execute baselines.
My near term goal is to make this a UI action you can trigger on a list of selected Projects, without having to update a script manually.
var logger = '';
var base_name = 'ScriptedBaseline1'; //whatever you want to name the baseline
var base_desc = 'Scripted Baseline 1'; //whatever you want to describe the baseline
var filter = "sys_class_name=pm_project^start_date>=javascript:gs.beginningOfToday()";
var projects = new GlideRecord('pm_project');
projects.addEncodedQuery(filter);
projects.query();
while (projects.next()){
logger += "Baselining " + projects.number + "\n";
createBaseline(projects.sys_id);
}
gs.log(logger);
function createBaseline(task_id){
logger = logger + "---in function \n";
var baseline = new GlideRecord("planned_task_baseline");
baseline.name = base_name.trim();
baseline.description = base_desc;
baseline.top_task = task_id;
var baseID = baseline.insert();
var ptasks = new GlideRecord("planned_task");
ptasks.addQuery("top_task",task_id);
ptasks.query();
while (ptasks.next()){
var baseItem = new GlideRecord("planned_task_baseline_item");
baseItem.baseline = baseID;
baseItem.task = ptasks.sys_id;
baseItem.start = ptasks.start_date;
baseItem.end = ptasks.end_date;
baseItem.insert();
}
logger = logger + "---finished loop \n\n";
}
EDIT: set the filter variable to whatever ENCODED QUERY gets you the projects you want to baseline.
- 894 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.