简体   繁体   English

脚本运行器中的Jira Groovy脚本

[英]Jira Groovy script in script runner

I'm trying to get users not in the jira-users group with email addresses not equal to: email@email.com. 我正在尝试使不在jira-users组中的用户的电子邮件地址不等于:email@email.com。 I can get the users not in the jira-users group(see below) but not sure how to complete the if statement to show "users email address not equal to email@email.com. I tried user.getEmail but couldn't get that to work. Would someone be able to make a suggestion with this? 我可以得到不在jira-users组中的用户(请参阅下文),但不确定如何完成if语句以显示“用户的电子邮件地址不等于email@email.com。我尝试了user.getEmail但无法获取可以。有人可以提出建议吗?

Thanks. 谢谢。

 for ( user in crowdService.search(query) ) { 
  if (!crowdService.isUserMemberOfGroup(user.getName(), "jira-users")) {
   body = body + user.getName() + "\n"
  }
 }

The User object implementation depends on your particular Atlassian setup. 用户对象实现依赖 你的特定Atlassian的设置。

Try calling user.getEmailAddress() : 尝试调用user.getEmailAddress()

for ( user in crowdService.search(query) ) { 
    if (!crowdService.isUserMemberOfGroup(user.getName(), "jira-users") 
            && !user.getEmailAddress().equals("email@email.com")) {
        body = body + user.getName() + "\n"
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM