The CreatorCon Call for Content is officially open! Get started here.

how can i fetch groups in to an array

lakng
Tera Contributor

i want to fetch few groups in an array,

after that if the change request is having approval for this groups the Approval automatically has to set No longer Required.

so here how can i write an business rule, which will check the approval group, if the approval group is one of these fetched ones, then the approval has to set "No longer Required"

 

1 ACCEPTED SOLUTION

Hi,

so can you add a log above if and print current.assignment_group and groups array and check what the value it contains.

Technically,both should be group sys_ids and if you think the assignment group present in your list of groups, then manually verify the sys_id of assignment group in the groups array or in your table.

Mark the comment as a correct answer and helpful if it helps.

View solution in original post

48 REPLIES 48

lakng
Tera Contributor

hi Asif, the log "Entered into the BR" is getting triggered.

and problem with the second log

there is some mistake in the given if condition

if(arrayUtil.contains(groups, current.assignment_group)) {
//If yes, then update approval to no longer required.
gs.log("Entered into the If condtion");
current.state="not requested";
}

here in this screenshot you can see the assignment group is not there in the sysapproval table

instaed it is having one Group approval table and in that it is having Assignment group field.

so i have tried 

if(arrayUtil.contains(groups, current.group.assignment_group)) {

but did not worked

Hi,

If you are from India, you can call me on my number, which is visible in my profile. It would be easier to understand and provide you assistance.

Hi,

so can you add a log above if and print current.assignment_group and groups array and check what the value it contains.

Technically,both should be group sys_ids and if you think the assignment group present in your list of groups, then manually verify the sys_id of assignment group in the groups array or in your table.

Mark the comment as a correct answer and helpful if it helps.

lakng
Tera Contributor

can we have a video sharing session sir?

lakng
Tera Contributor

Thank you so much for your support on this issue Asif. Kudos to your Work.