Prevent sending emails to specific groups

Can I somehow prevent sending issue create/update email to specific users?

I have A users belonging to a Jira Users group. Then I have B users NOT belonging to it, but having access to projects. So group A can access jira and do whatever they like, group B is able to send emails into the system, but is not able to login.

Fine so far.

Strange is, that group A is getting nicely formatted HTML mails, group B is getting text-style emails. As there IS a difference already, can I somehow disable sending emails to group B fully? I would rather prefer that instead of sending the html emails, as the html emails would still contain links to jira. As they can not login, I would not like sending out the links anyway.

Thanks

4 answers

1 accepted

This widget could not be displayed.

Well in this case you can try the following untested code snippet:

#if($jiraUserUtils.getGroupNamesForUser($recipient.getName()).contains("JIRA-USERS-GROUP")) 
## here comes the content with link
#else 
## here comes the content without link
#end


I'll try that and give you feedback, thanks :)

It works, perfect!! So, I'll get my mails configured now.... Thanks a lot!

This widget could not be displayed.

you can restric to send mails by using Notification scheme, find the following document to configure notification scheme

https://confluence.atlassian.com/display/JIRA/Creating+a+Notification+Scheme

Thanks, I know about this page.

Maybe more clearly:

I want to send out notifications to all reporters, assignees etc..., but NOT if they do / do not belong to a group. I can only choose to send notifications to assignees, but not according to the above filtering.

Any chance?

Thanks!!

This widget could not be displayed.

To send email out to group B without links you can edit freely the templates as it is described at https://developer.atlassian.com/display/JIRADEV/Adding+Custom+Fields+to+Email . E.g. drop out the links from the text templates and set group B getting text-style emails.

This could actually work out!

How would it look like to check if a specific group is set or not? I am sadly not a java-guru to have a good idea.

#if ($issue.getCustomFieldValue("customfield_10000"))
>$stringUtils.leftPad($issue.getCustomField("customfield_10000").name, $padSize): $issue.getCustomFieldValue("customfield_10000")
#end

I should be sonething like:

#if ($issue.isMemberOfGroup("JiraUsers"))
mail content for jira users
#else
mail content for non-jira users #end

How can I test against a group? Thanks a lot!! (We're getting closer, that could solve it, yeaa :-))

This widget could not be displayed.

At one of our customers we have prosposed for the very same problem the following solution in the template:

#if($recipient.getEmail().endsWith(”yourcompany.com”)) 
## here comes the content with link
#else 
## here comes the content without link
#end

assuming non-jira users can be separated upon the email domain.

No, that's not the case. There are loads of different email-addresses...

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted an hour ago in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

8 views 0 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you