Help me on the Display BR need to perform the activity

kranthi2
Tera Expert

Hi,

Using Display BR that automatically populates the "Short Description" field of a Problem Task with the "Problem Statement" from the related Problem when the task is created. Additionally, ensure that the "Assignment Group" and "Assigned To" fields in the Problem Task are populated with the corresponding values from the Problem.

 

Thanks,

 

 

4 REPLIES 4

Viraj Hudlikar
Giga Sage

Hello @kranthi2 

 

VirajHudlikar_1-1737805905342.png

 

In Advanced tab section under script field write code as below:

 

(function executeRule(current, previous /*null when async*/ ) {
    // Add your code here
    current.short_description = current.problem.short_description;
    current.assignment_group = current.problem.assignment_group;
    current.assigned_to = current.problem.assigned_to;
})(current, previous);

 

 

 

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

Hi @Viraj Hudlikar 

It works, thanks.

@SreenadhV -

Glad that it helped you.

You can also mark it as helpful 👍

Juhi Poddar
Kilo Patron

Hello @kranthi2 

1. Create the Display Business Rule

  • Table: Problem Task [problem_task]
  • When: Display
  • Condition: Problem is not empty
  • Script: Populate the fields with values from the related Problem record.

Configuration setup

JuhiPoddar_0-1737805395684.png2. Script for the Display Business Rule

 

 

(function executeRule(current, previous /*null when async*/) {
    // Check if the related Problem record exists
        var grProblem = new GlideRecord('problem');
        // Query the related Problem record
        if (grProblem.get(current.problem)) {
            // Set Short Description from Problem's Problem Statement
            current.short_description = grProblem.problem_statement;
            
            // Set Assignment Group and Assigned To from the Problem record
            current.assignment_group = grProblem.assignment_group;
            current.assigned_to = grProblem.assigned_to;
        }
})(current, previous);

 

The above business rules check if the problem field is not empty and then trigger the BR and populate the fields in problem_task record with the corresponding values from the Problem.

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar