Forums

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

How to send email notifications to external users( non-licensed users)?

Srikanth August 5, 2021

Hi ,

Is there a way to send email notifications to external users( non-licenced users ) using jira mail handler ?

we are using the jira server version of 8.1.3

 we want to send the notification to the sender( non-jira user) when the request is created by jira mail handler.

 Quick response would be highly appreciated. 

Thanks

1 answer

0 votes
Vikrant Yadav
Community Champion
August 5, 2021

Hi @Srikanth If jira is creating issue of external users email… it means default reporter is set … that’s why issues are creating . 
1. Instead of Setting default reporter . Check create new users .. so that user account created in jira system and user received issue creation email. Remove user from jira-users group to save license 

2. Use script runner plug-in to capture email address and send email notification when issue get created.

Thanks

vikrant yadav

Srikanth August 6, 2021

Hi @Vikrant Yadav 

thanks for the response.. 

1. we are using external user management to create users and users will be added to jira through Active directory only. so i don't think that Create user option will help in our case.

2. Do we have any in-built script in script runner plug-in to cpature email address or do we need to write some script using scripr runner plug-in..?

Regards

Srikanth

Vikrant Yadav
Community Champion
August 6, 2021

Hi @Srikanth  Try below script to capture email address, script capture email address from Description field and paste it in a Text field:- 

Apply  this in Post function at top :- 

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.component.ComponentAccessor
import java.util.regex.Matcher
import java.util.regex.Pattern

def customFieldManager = ComponentAccessor.getCustomFieldManager()

def desc = issue.getDescription()

def result = desc.substring(desc.lastIndexOf("mailto:") + 7, desc.indexOf(">"))


def targetField = customFieldManager.getCustomFieldObjects(issue).find {it.name == "Employee Email"}

def changeHolder = new DefaultIssueChangeHolder()

targetField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(targetField), result),changeHolder)

 After Issue Created Event post function, apply one more Script runner post function , "Send Custom Email(SR) " 

In This post function, select Email field in To field. 

Thanks

Srikanth Mamidala
Contributor
April 4, 2022

Hi @Vikrant Yadav 

I am looking for same feature within our Jira cloud and I read your idea but unsure on how to achieve this. Have some questions on your ideas.

1. Instead of Setting default reporter . Check create new users .. so that user account created in jira system and user received issue creation email. Remove user from jira-users group to save license 

  • Once the new users are created how do we automatically remove users ? Manual effort to remove users everytime user is created a jira ticket seems very cumbersome

2. Use script runner plug-in to capture email address and send email notification when issue get created.

  • Not familiar with script runner at all, and is there a preconfigured code which does the job of sending email to external users (not sure how and where it picks up the email from though) once issue is created 
Vikrant Yadav
Community Champion
April 4, 2022

Hi @Srikanth Mamidala  For JIRA Cloud, easiest way is to use JIRA Automation, to capture email address from Description in a custom field and send email to that captured email address. 

Some similar posts, might helps you :- 

 

https://community.atlassian.com/t5/Automation-questions/How-can-I-pull-the-email-address-from-the-Description-section-of/qaq-p/1521498

 

https://community.atlassian.com/t5/Jira-questions/Automation-Regex-extract-email-address-from-Issue-Description/qaq-p/1714786

 

Thanks

V.Y

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.1.3
TAGS
AUG Leaders

Atlassian Community Events