Ritm visibility using assignment group and parent group

jobin1
Tera Expert

Hi All

Need to get the below 3 values in Query BR how it can be achieve?

1. How we can get the current logged in user assignment group and its parent group in query BR?

2.How all Ritm group and its parent group can be get from Query BR.

3. If 1 and 2 are same(both condition returns same value) then those Ritms should only visible to logged in user

1 ACCEPTED SOLUTION

(function executeRule(current, previous /*null when async*/ ) {
    var childIds = "";
    var groups = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
    groups = groups.toString();    
	current.addEncodedQuery("assignment_group.parentIN"+groups+"^ORassignment_groupIN"+groups);
})(current, previous);

View solution in original post

25 REPLIES 25

Murthy Ch
Giga Sage

Hi @jobin 

Do you mean that you want to show ritm's which are part of a loggedIN user groups?

Thanks,
Murthy

@Murthy Chintalapudi Yes and its parent group as well.

Hi @jobin 

Try this in query BR:

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

    var a = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups()); //this will return both loggedin user groups and its parent groups
    current.addQuery("assignment_group", "IN", a.toString());

})(current, previous);

(=tested)

 

Thanks,

Murthy

Thanks,
Murthy

@Murthy Chintalapudi You're code is working for assignment group members but when the parent group members are impersonating that time its not working. Any other changes required?

for example  "A parent" is the parent group of "A child" now members of A child are able to see only "A child" tickets that is working but all members of "A parent" also should able to see "A child" ticket as well this is not working