- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2014 12:23 AM
Here is what I am trying to accomplish:
As part of a Change Request Record Producer, the user selects from one of a set of Project Plan templates that closely matches the type of change. Or perhaps the workflow figures out which project template to use based on the answers to questions from the Record Producer. In either case, the Record Producer launches the Change Request workflow and the workflow creates a project and attaches it to the ticket. The Change Request is used to track the approvals and the production deployment. The project plan is used to track all the work. The variables capture details of the original request. Since this is the real world, we can expect both the Change Request and the Project Plan to be modified before both are closed. The two tasks are linked since they represent two different views of the same change (or project).
There does not seem to be any concept of a Project Plan Template in ServiceNow. You can copy a project from another project, so I guess that would be okay. But it seems to be UI functionality. I can not figure out how to make a copy of a Project Plan from inside a workflow.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2014 12:51 PM
It may not be the only solution but from what you have said and you are trying to achieve, it would work.
The only other way would I can think of would be to create some new tables to store the project template variables and tasks to be created.
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2014 04:29 AM
Hi Giles,
So if I understand this correctly:
User fills in a record producer and selects from a drop down, a project plan template.
A "Project Plan" is just a predefined project on the project application in SN.
When the request is submitted, you require the "project plan" to be created and cross referenced with each other.
For creating the project plan, I can think of two ways.
1. On the change workflow, right the code to create the project (using the create task function) with the required fields and then add the task to this project.
You would have logic on the workflow to pick the correct "project" to be created in the workflow from the drop down.
2. As you said, create some projects which can be used as templates (maybe have an additional field to say they are template or not)
On the workflow, use the copy project function to create a new project and attach to the change.
I checked the copy function in SN. This calls the "copy_project" UI page. The processing script then copies the project for you. You could amend this in either of the cases above to do what you want. It depends on who needs to keep the project template details up to date.
If your SN development team don't want to, option two is the best. Your project team can amend/create/delete accordingly. If your project templates hardly/never change or you need more coding control over how the project is created, then option 1 may be better but from a admin/management, option 2 is better.
Let me know if this is what you were looking for.
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2014 10:03 AM
I am not interested in creating an empty project. I want to create a project fully populated with task hierarchy and dependencies. It appears that "copy_project" knows how to do this. I took a look at the script. It seems to recursively copy the project tasks and then copy all the task relationships.
I do not think there is any way to call a UI page from a workflow. But I suppose I can grab the code from the UI Page and put it my own Script Include. I can then call from the Script Include from the workflow. Is this my best and only solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2014 12:51 PM
It may not be the only solution but from what you have said and you are trying to achieve, it would work.
The only other way would I can think of would be to create some new tables to store the project template variables and tasks to be created.
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2014 04:56 AM
The Project module can be used to add tasks and manage workload, and then related to other tasks types such as Change Requests to manage the rollout.
In your Change workflow you could use a Run Script workflow action to create a new Project Plan record, then set the relationship to the Parent change, and add some kind of unique identifier to distinguish these Project Plans from those created by others:
var pr = new GlideRecord('pm_project');
pr.initialize();
pr.parent = current.sys_id;
pr.short_description = "SOMETHING UNIQUE";
pr.insert();
You can then create a workflow that runs on the pm_project table and the run condition is set to the short_description value above. This workflow can be then set up to give you the templated project plan with tasks, resources, etc.