Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Validator to Identify users who have already joined the group and notify them

Nagaraju November 20, 2022

I am trying to create a Validator script to notify the users who are alreadymembers of the group. 

2 answers

1 accepted

5 votes
Answer accepted
David Fischer
Community Champion
November 20, 2022

Hi @Raju 

you can use this code:

!issue.get("customfield_10113").any{ it.isInGroup(issue.get("customfield_10112").name) }
Nagaraju November 20, 2022

.

David Fischer
Community Champion
November 20, 2022

Hi @Raju ,

sorry, I missed that in your initial request.

Try this:

def users = issue.get("customfield_10113")?.findAll{ it.isInGroup(issue.get("customfield_10112").name) }
if (!users)
return true
return "Users ${users*.displayName.join(", ")} are already in group ${issue.get("customfield_10112").name}"
Like Vikrant Yadav likes this
Nagaraju November 20, 2022

@David Fischer 

Its worked. Thanks David. Cheers.

TN Raju November 21, 2022

.

0 votes
Alex Koxaras _Relational_
Community Champion
November 20, 2022

Hi @Raju 

I don't quite follow what you want to accomplish here. Can you please explain the "stage" properly? What happens? When does it take place? Who enters the value?

TN Raju November 20, 2022

.

Suggest an answer

Log in or Sign up to answer