Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How many users opened one incident and how get users list

Ajay gadudasu
Tera Contributor

How many users opened one incident and how get users list

2 REPLIES 2

Not applicable

Not applicable

Hi @Ajay gadudasu 

 

You can create a list field on the form and use display business rule to save those users in the list. An outline of the Display BR is as follows-

 

(function executeRule(current, previous /*null when async*/ ) {
if (current.isNewRecord())
return;
var currentUser = gs.getUser().getID();
var oldusers;

oldusers = current.u_incident_viewers; //List field to store 
var user = oldusers.split(',');

var i;
for (i = 0; i < user.length; i++) {
var old = user[i];
if (old == currentUser) {
return;
}
}
current.u_list_viewers += ',' + currentUser;
current.update();

})(current, previous);

Please mark my answer helpful and correct.

 

Regards,

Amit