We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Populate previous assignment group on incident form

Not applicable

Hi Experts,

I have created a field on incident form “Previous assignment group” which captures the value of previous assignment group. I have written below business rule to populate it but it’s working only if the variable field type is string.

 

current.u_previous_assignment_group = previous.assignment_group.getDisplayValue();

 

We want to use this field for report so that user can fetch it dynamically but it does not work if we keep the field type as reference.

 

Please help.

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron

@Community Alums Please update your script as follows.

 

current.u_previous_assignment_group = previous.assignment_group+'';

//u_previous_assignment_group should be a reference field referring to sys_user_group.

Hope this helps.

View solution in original post

4 REPLIES 4

Sandeep Rajput
Tera Patron

@Community Alums Please update your script as follows.

 

current.u_previous_assignment_group = previous.assignment_group+'';

//u_previous_assignment_group should be a reference field referring to sys_user_group.

Hope this helps.

Not applicable

Hi Sandeep, Hope you are doing well!

I have modified the script as below since I want to get only the first assignment group i.e. the assignment group used while creating the incident.

 

(function executeRule(current, previous /*null when async*/) {
if (current.u_previous_assignment_group == "") {
current.u_previous_assignment_group = previous.assignment_group+'';
}
})(current, previous);
 
But this is populating only when the first assignment group is empty due to my condition of checking if the field is empty.
 
How can I populate this field with the first assignment group on incident record.
Kindly advice.

Not applicable

Thank you Sandeep. It working fine 😊

Not applicable

Hi Sandeep, Hope you are doing well!

I have modified the script as below since I want to get only the first assignment group i.e. the assignment group used while creating the incident.

 

(function executeRule(current, previous /*null when async*/) {
if (current.u_previous_assignment_group == "") {
current.u_previous_assignment_group = previous.assignment_group+'';
}
})(current, previous);
 
But this is populating only when the first assignment group is empty due to my condition of checking if the field is empty.
 
How can I populate this field with the first assignment group on incident record.
Kindly advice.