liju's picture

I am new to ARIS scripting and was trying to write a script to fetch all the group names and child group names from a selected Group. Following is my code and it is only returning the Parent group. Can someone please tell me what is wrong with my code?


var nLocale = Context.getSelectedLanguage();

function main(){
    var oOutput = Context.createOutputObject();
    var aGroups=ArisData.getSelectedGroups();
    for (var i = 0; i < aGroups.length; i++) {            
    var oGroup = aGroups[i];                    // Current Group
    var sGroupName = oGroup.Name(nLocale);      // Name of current Group
    oOutput.OutputLn(sGroupName, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);