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
‎03-28-2017 11:42 AM
The script I'm looking at is the "Create Strategic Type on Approve" business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2017 11:29 AM
Hi,
Prior to Istanbul, Business Rule "Create Strategic Type on Approve" works and the script shown in your thread above also works fine. But from Istanbul onwards, this Business Rule has been made inactive OOB and To copy fields Values and other functionality from Demand to Project there is a Script Include "DemandToProjectCreationHelper" which is being used and this needs to be modified to copy your Business Case Value to Description field on the Project Form as shown below:
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 06:04 AM
Can this be done with the Demand Number? I'd like to pull a link to the Demand Number into the Project so that once the Project is set up there would be an easy way for the team member to click back to the Demand if they wanted to.
I tried adding to the "DemandToProjectCreationHelper" script include (with and without "Display" in the set/getValue lines). Neither worked.
project.setValue("short_description", demand.getValue('short_description'));
project.setValue("primary_portfolio", demand.getValue("portfolio"));
project.setDisplayValue("u_demand", demand.getDisplayValue("number"));
thanks,
Richelle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 06:16 AM
After reading the Include Script a little closer, I tried something that worked to pull in demand number/link into the project...(added line 6 below) -"u_demand" is the reference field on my project form.
if(sys_id && !projId) {
var project = new GlideRecord(projectTable);
project.initialize();
project.setValue("short_description", demand.getValue('short_description'));
project.setValue("primary_portfolio", demand.getValue("portfolio"));
project.setDisplayValue("u_demand", demand.getDisplayValue("sys_id"));
if(project.isValidField('primary_program')){
project.setValue("primary_program", demand.getValue("primary_program"));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 08:29 PM
Yeah that is possible. Create a New Reference Field on the project Table say "Demand" and refer it to the Demand Table. Once the field is created, Update your Script Include as shown below in the screenshot:
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke