Demand field copy to Project

sip
Tera Contributor

Hi Folks ,

I have a requirement where in once am creating a project from demand the requirement field from demand should get copied to the requirement field of project .
PFA ,once I click on that new button on project it creates a new record for project and the value from demand requirement field should get copied to the project requirement field.

Any help would really be appreciated.Thanks in advance folks

9 REPLIES 9

Manal  AQUIL
Tera Contributor

Hi @sip 

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.

Manal  AQUIL
Tera Contributor

Hi @sip 

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.

This a great solution!! Thank you!

-ooo-
Tera Contributor

@Manal Aquil  I have below Requirement:-

 

2. On Click of create project uI link : copy custom demand field to project.

 

a. Custom " Project Type" field should also be copied on Project Creation from Demand
b. Move the Demand to Completed state on Project Creation

Can you explain step by step, how we can archive this .

 

Thank you.

 

Namita Mishra
ServiceNow Employee
ServiceNow Employee

Hi @-ooo- ,

You can achieve point #2 by using out of the box option.

On the demand form -> Preferences-> Select the value 'On creation of project' for 'Close Demand' field as shown below.

 

Screenshot 2024-01-03 at 1.28.21 PM.png

 

Please mark this answer as correct response if it resolves the query.

 

Thanks,

Namita Mishra