- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 04:05 PM
Hello All,
It's been requested that I come up with a way to "set up" a project task list.
We have over 1000 Club Locations in North America and we have a project to replace Monitors. I am looking for a way to create a task for each location so the manager doesn't have to sit and create a new task for each.
Initially, I just had my techs create a task for each location as they worked on it but that made reporting the progress of the project impossible.
Any ideas on how this can be done? I can get more specific if needed but hoped the over all idea makes enough sense as I will want to do this for many of the projects that come up.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 04:26 PM
Hi Carl,
If it were me, I'd create them using a script. If it is a 1-1 relationship between locations and tasks, use your location list as a "template" to create tasks and relate them to the parent project record.
For example (untested)
var projectID = '(sys_id_of_parent_record)';
var loc = new GlideRecord('cmn_location');
// Additional query filters here to limit the records
loc.query();
while (loc.next()) {
var ptask = new GlideRecord('pm_project_task');
ptask.newRecord();
ptask.short_description = 'Monitors for ' + loc.getDisplayValue();
ptask.parent = projectID;
ptask.insert();
}
Try this with a limited number of records (eg. add loc.setLimit(3); in the initial query) to ensure it works. I'm not sure I have the parent/child thing quite right.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 04:13 PM
Hi Carl,
Will this be a one time job to create task or is it needs to fit as part of some process.
If this is one time job then we can write a script and create tasks. Please let me know if I am missing something.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 04:30 PM
Once we have more details on this, we will be able to further help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 05:26 PM
Thank you.
Initially thinking, I'd want to be able to use it (with modifications) any time we get an "all clubs" task.
This month it's "replace monitors", next month or quarter may be it's "perform manual IT Hardware inventory" or "replace payment readers".
But to answer the question, it's a one time creation per project
Get Outlook for iOS<https://aka.ms/o0ukef>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 05:29 PM
Thanks Carl for the update.
Please refer to the script shared by Chuck. Adjust it and let us know if you are blocked.
Please refer below link on how you can execute this via background script or fix script.
Background Scripts — ServiceNow Elite
http://wiki.servicenow.com/index.php?title=Fix_Scripts