Send Email on Create Issue - JIRA API

Matheus Silva November 4, 2020

Hey, I need a help

 

I am trying to send a default email when i create a issue on JIRA API

When i use the interface, the system send a email to me, but on API does not

 

Thanks

2 answers

0 votes
T_S_ December 23, 2020

Having the exact same Problem like @Matheus Silva 

 

I created tons of issues but non of my users who created issues are getting an email. For completion, this is the way i'm doing it:

  • check if user (by username) is already registerd
  • if not, i create a new user with the data given
  • if yes, i'm saving the users details
  • than create the issue with this format:

 

 let issue = {
"fields": {
"project": {
"id": "10402"
},
"summary": req.body.company + ' | ' + req.body.salutation + ' ' + req.body.surname + ' | ' + req.body.category,
"issuetype": {
"id": "10103"
},
"reporter": {
"self": "https://jira.domain.de/rest/api/2/user?username=" + finalUsername,
"name": createUser.name,
"key": createUser.key,
"emailAddress": createUser.emailAddress,
"displayName": createUser.displayName,
"timeZone": "Europe/Berlin"
},
"description": fullDescription
}
}

 No email for the tickets created via rest api, emails for tickets created via web, directly in service desk are fine.

T_S_ December 23, 2020

Seems like there is an extra endpoint for notification?! What is that for?

 

https://docs.atlassian.com/software/jira/docs/api/REST/8.13.2/#api/2/issue-notify

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 5, 2020

Hello @Matheus Silva

Welcome to the Atlassian Community!

By default, the notifications for issue creation can be configured in the project notification scheme and it's applied for any methods of creation (Using JIRA REST API or the User interface).

The only thing that could be causing the notification to not trigger in one of those methods would be if you're creating the issue using the customer portal or the internal UI. They use different notification templates.

When creating the issue in the SD portal as a customer, you can configure customer notifications under project settings > Customer Notifications, as described in the documentation below:

Customer notifications  

For notifications using the internal UI (as an Agent), you can configure it under project settings > Notifications:

Agent notifications using the Notification scheme 

Please, take a look at the documentation above to confirm you're all set. If you still facing any problems, please provide us with a screenshot of your interface when creating the issue and the REST API call you are using, properly hiding any sensitive information from both.

Also, please confirm if the user not receiving the notification is a Customer or an Agent on your Jira site.

Let us know if you have any questions.

Suggest an answer

Log in or Sign up to answer