How to copy Demand fields to Project fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2017 09:13 AM
When a Project is created from a Demand, how do I copy the Business Case field on the Demand table to the Description field on the Project table?
So far I've copied the Demand Business Rule, "Create Strategic Type on Approve" and added the bolded line but it doesn't seem to work:
function createNewProject(){
var project = new GlideRecord("pm_project");
project.initialize();
project.setValue("short_description", current.short_description);
project.setValue("description", current.business_case); //copy DMND business case to PRJ description
project.setValue("parent", current.sys_id);
Thoughts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2022 12:38 AM
Please follow below steps to copy demand fields to project.
1. Create before insert BR on pm_project with condition demand changes.
2. PFB script (replace the backend name of your custom field to be copied)
var refDmd = current.demand.getRefRecord();
current.u_sponsor_guid = refDmd.getValue('u_sponsor_guid');
This will copy demand field value from demand to project without making any changes to OOB Script Include : DemandToProjectCreationHelper.
P.S: Please mark helpful, if it works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2017 10:43 AM
Thank you bharath_kumer, the name of the script include is AjaxCreateRelatedEntityFromDemand, I added the lines as you said and it worked for me!
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2017 10:25 AM
Thanks bharath_kumar.
It script include works for me too.
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2017 04:47 PM
It should copy more than just the short description. If the fields are filled in, it should copy them over to appropriate field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2017 09:08 AM
That is the behavior I was expecting. I'm not sure why it is not.