The 'Short Description' field from the release parent is not populating the 'Project Name' field

CarolMa6
Tera Expert

Hi, 

 

I'm trying to configure the 'Short Description' field from the release parent to populate the 'Project Name' field in related tasks. However, the current business rule is incorrectly updating the related tasks using the 'Description' field from the related phase task instead of the release parent.

 

table: rm_task

when: display

script: 

(function executeRule(current, previous /*null when async*/ ) {

    current.u_project_name = current.parent.short_description;

})(current, previous);

 

Regards 

CarolMa

 

 

14 REPLIES 14

@CarolMa6 

 

Can you provide table names and business requirements you are trying to achieve ?

 

You need to gliderecord on the related task table and set the field value(s). You have a BR on 'rm_task' table but it is not clear from your code or screenshots what you are trying to achieve. Please provide more details.

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

@Bhuvan  

requirements - The Project Name field in the Release Task record (table: rm_task) must automatically populate with the Project Name from its related Parent Release record (table: rm_release).

Current Issue:

Instead of pulling the Project Name from the Parent Release record, the system is currently populating it from the related Release Phase Task record. This is incorrect and does not meet the requirement.

 

Regards, 

CarolMa 

@CarolMa6 

 

Create a Before Business Rule as below

 

Bhuvan_0-1756882344023.png

(function executeRule(current, previous /*null when async*/) {
// Add your code here
var grProject = new GlideRecord('rm_release');
grProject.addQuery('sys_id','=',current.parent);
grProject.query();
while(grProject.next())
{
current.setValue('u_project_name', grProject.short_description); 
}
}
)(current, previous);

 

Below is a sample release task record created  for testing. Custom field Project name 'u_project_name' in 'rm_task' is set with parent Release 'rm_release' short description value.

Bhuvan_1-1756882733018.png

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

@Bhuvan  

 it works but from some reason the release task project name field is updated from the release phase record see below 

CarolMa6_0-1756907916223.png

 

CarolMa6_1-1756907982198.png

 

Why is the rule picking a short description from a different table?

 

@CarolMa6 

 

Can you share tables names and field names so that I can compare with my PDI. Please explain end to end process of what you are trying to do and share Business Rule you have created in your instance.

 

I believe you have changed out of box behavior and you would need to fine tune the BR according to your customizations.

 

I hope you appreciate the efforts taken to replicate this in PDI and share you with information. If my responses helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan