- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2017 06:47 AM
Hi,
Just wondering if anyone has figured out how to apply project templates to a new project within a workflow.
Thanks,
Patrick.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2018 11:47 AM
Ended up figuring this one out.
Insert the project first:
var grProject = new GlideRecord('pm_project');
grProject.assigned_to = current.request.requested_for;
grProject.project_manager = current.request.requested_for.manager;
grProject.short_description = current.variables.u_projectName;
grProject.primary_portfolio = current.variables.u_portfolio;
grProject.description = current.variables.u_description;
var projectId = grProject.insert();
var templateId = "<template sysID here>"; //found under the templates section within projects
Then with the variables above, apply the template with a specific method found in the 'create_project' UI page:
GlideProjectTemplate.apply(templateId, projectId, <string for datetime>);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2018 11:47 AM
Ended up figuring this one out.
Insert the project first:
var grProject = new GlideRecord('pm_project');
grProject.assigned_to = current.request.requested_for;
grProject.project_manager = current.request.requested_for.manager;
grProject.short_description = current.variables.u_projectName;
grProject.primary_portfolio = current.variables.u_portfolio;
grProject.description = current.variables.u_description;
var projectId = grProject.insert();
var templateId = "<template sysID here>"; //found under the templates section within projects
Then with the variables above, apply the template with a specific method found in the 'create_project' UI page:
GlideProjectTemplate.apply(templateId, projectId, <string for datetime>);