is possible to get only 1 group on '#currentUser.groups.name#' when 1 user have 2 assign group different ?

Confluence User - 21 Mar, 2024

i currently try used #currentUser.groups.name# but when i used it is show all assign group for that user for example when i use console log the show is  "namegroup1 , namegroup2". so is possible to get only 1 group name by index or something ? 

hashvariable;currentuser;group

1


22 Mar, 2024
confluenceUser
1
confluenceUser

import org.joget.commons.util.*;

String userGroups = "#currentUser.groups.name#"; 
LogUtil.info("received groups for current user " , userGroups);

String[] userGroupsArray = userGroups.split(";"); 
String group2 = userGroupsArray[1]; 

return group2;



Maybe you can try a beanshell script to get the group you want. How to develop a Bean Shell Hash Variable


RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print