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
‎01-29-2018 08:11 AM
Hello Shloke
On our instance, Project name on the Demand was changed awhile ago, but it broke functionality to the Project Console. I have added back the short_description on the (task) table back to the demand. When approving a Demand, the project is created but is not showing the Project Name short_description on the (task) table on the Project. I need help getting it to populate that field. I have looked at all information above and do not see any changes this is currently on the Script Include.
project.setValue("short_description", demand.getValue('short_description'));
We are currently on Helsinki Patch 9 and will be moving to Jakarta Patch 7 soon, but I would like to fix this before the upgrade.
Any help is gratefully appreciated.
Thanks
Denee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 12:36 AM
Thanks Shloke
You have to change update both Business Rule (Create Strategic Type on Approve) as well as Script Include (DemandToProjectCreationHelper).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2022 12:36 AM - edited ‎10-27-2022 12:37 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.