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.

need help with Script include

Renu4
Tera Contributor

Hello All,

i have a script include in which i would like to add 3 groups in the condition but not sure how to do it .need some help.

The script is:

   if (!gs.getUser().hasRole('ABS_EXT_FTS'))
        {result += '^name!=EXT_FTS' ;}
        return result + '^ORDERBYDESCu_order';
    },
I want to change the result line where the groups can be multiple like below.;
 
   if (!gs.getUser().hasRole('ABS_EXT_FTS'))
        {result += '^name!=EXT_FTS' ; || '^name!=EXT_FTS_NW' ; || '^name!=EXT_FTS_Storage' ; }
        return result + '^ORDERBYDESCu_order';
    },
 
How do i achieve it.
1 ACCEPTED SOLUTION

if (gs.getUser().hasRole('itil')) {
    result += '^nameINEXT_FTS,EXT_FTS_NW,EXT_FTS_Storage'; 
}
else if(gs.getUser().hasRole('ABS_EXT_FTS')){
result += '^name!=EXT_FTS^name!=EXT_FTS_NW^name!=EXT_FTS_Storage'; 
}


return result + '^ORDERBYDESCu_order';

View solution in original post

5 REPLIES 5

Sandeep Rajput
Tera Patron

@Renu4 Update your script as follows.

   if (!gs.getUser().hasRole('ABS_EXT_FTS'))
        result += 'name!=EXT_FTS^ORname!=EXT_FTS_NW^ORname!=EXT_FTS_Storage';
        return result + '^ORDERBYDESCu_order';
    },

Hope this helps.