Email This Issue
📈 Marketplace❓ Support❤️ Feedback🏠 META-INF Apps
Email This Issue - for Jira Server/Data Center
Email This Issue - for Jira Server/Data Center
  • ⬇️Start Here
  • Email This Issue - for Jira Server/DC
  • Features
  • Secure the email channel with Email This Issue
  • Comparing Email This Issue and Jira Server/DC
  • 🤓Documentation
    • Outgoing Emails
      • Sending manual emails
        • The difference between email editors
        • Enabling template categories so templates can be chosen on the Email screen
        • Mail Generation Queue (formerly called Event Queue)
        • Manual Email Default Settings
      • Sending issue filters by email
      • Email templates
        • Adding custom macro to email templates
        • Adding Email Audit Log to email templates
        • Adding fields to email templates
        • Adding issue comments to emails
        • Adding issue link information to your template
        • Adding issue operation links to the email
        • Adding a signature with a company logo to emails
        • Adding user properties to emails
        • Disabling links and avatars or icons in templates
        • Formatting Date and Time values
        • Using reply templates
        • Using Mail Body Initializer templates
        • Rendering templates within templates
        • Velocity Context in email templates
        • Formatting number values
        • Searching for issues in email templates
        • Changelog information in email templates
        • Canned responses
      • Contexts
        • Context Resolution Algorithm
      • Event Notifications
      • Distribution lists
      • Workflow post functions
      • Custom fields
    • Incoming Emails
      • Attachment Filtering
      • Next Generation Mail Handlers
        • Jira automation and Next Generation Mail Handlers
        • Using regular expressions
      • Classic Mail Handlers - Deprecated
        • Mail Handler Error Log
        • Step-by-step Classic Mail Handler to Next Generation Mail Handler migration aid
        • Field Rules
        • Phasing out the Classic Mail Handler
        • Comparing the Classic and the Next Generation Mail Handlers
    • Integrations
      • CRM for Jira
      • nFeed
      • Glass Documentation
      • API - Integration with other services
    • Administration
      • General configuration
      • Email Audit Log
      • Outgoing Mail Connections
      • Outgoing Mail Queue
      • Incoming Mail Connections
      • Incoming Mail Queue
      • Incoming Mail Log
      • Backup and restore settings
        • Backup and restore administration
          • Backup menu
          • Restore menu
        • Backup and Restore Tutorials
          • Backup and restore for empty email settings
          • Backup and restore only parts of a configuration
          • Backup and restore every setting in the same instance
      • OAuth2 Authorizations in Email This Issue
        • OAuth2 Client Credentials
        • Authorizing Email This Issue to access Gmail accounts
        • Authorizing Email This Issue to access Microsoft 365 accounts
        • Enabling OAuth2 Authorization in your Google Account
        • Enabling OAuth2 authorization in your Microsoft 365 account
        • Troubleshooting guides for Microsoft OAuth2 Connections
          • How to fix "Authorization Was Interrupted" error
          • How to fix "BAD User is authenticated but not connected" error
          • How to fix "401 Unauthorized" error
          • How to fix "key expires_in " error
          • How to fix "Need admin approval" error
      • Alerting via Webhooks
        • Webhooks
          • Configuring Slack to receive webhooks
          • Configuring OpsGenie to receive webhooks
        • Webhook execution logs
      • Email Security
    • Service management integration
    • JQL Functions
    • Top-level menu navigation
  • ☁️Server to Cloud Migration
    • Server to Cloud - Automatic Migration tool
    • Server to Cloud - Manual migration guide for Email This Issue
      • Overview of available features
      • Differences of the Server and Cloud user interface
      • Migrating Outgoing Settings
        • Migrating Templates
        • Migrating Notifications
        • Migrating Manual Email Defaults
        • Migrating Contexts
        • Migrating Canned Responses
        • Migrating Post Functions
        • Migrating Outgoing Mail Connections
      • Migrating Incoming Settings
        • Migrating Classic Mail Handlers
        • Migrating Next Generation Mail Handlers
        • Migrating Incoming Mail Connections
        • Migrating Incoming Mail Queue Settings
        • Migrating Incoming Mail Log Settings
      • Migrating Other Settings
        • Migrating OAuth2 Credentials
        • Migrating global default email settings
        • Migrating permissions for sending emails manually
        • Migrating recipient restrictions
  • ❓FAQ
    • FAQ
      • How to bypass workflow conditions
      • How to avoid email loops
      • How to control who to send emails to
      • How to customize Email From in outgoing emails
      • How to enable logging
      • How to install license keys
      • How to find out why the Email button is missing
      • How to obtain a community or non-profit license
      • How to prevent duplicate emails
      • How to remove old content from reply emails
      • How to send personalized emails to recipients
      • How to set up auto-reply or acknowledgment emails
      • How to track cases when you don't get any emails
      • How to view the log of incoming and outgoing emails
      • The iOS Mail app does not show attachments
      • How to route emails to projects
      • How to maintain email threads in Jira
      • How to fix issues with a corrupt index state
      • How to set polling interval for mail accounts manually
    • Tutorials
      • Configuring email approval
      • Customizing the email template used with manual emails
      • Enhance Jira Service Management with Email This Issue
      • Getting Started
      • Setting up an Email Help Desk
      • Setting up customized notifications
      • Setting up a Service Management with a Next-Gen Mail Handler
  • 🌪️Misc
    • Open Source Components
    • Pricing Updates
      • Pricing Update effective October 1st 2018
      • Pricing Update effective December 1, 2021
    • End of Support Policy
    • Security Advisories
      • Email This Issue Security Advisory 2020-02-18
    • Database Tables
    • Translations
  • 🆕Release Notes
    • Release notes
      • 9.x.x
        • 9.15.0 Jira 10 compatibility
        • 9.13.0 Improvements and Fixes
        • 9.11.0 Improvements and fixes
        • 9.10.0 Major improvements and fixes
        • 9.9.1 Improvements and fixes
        • 9.9.0.2 Major improvements and fixes
        • 9.8.0 Improvements and fixes
        • 9.7.0 Improvements and fixes
        • 9.6.0 Improvements and fixes
        • 9.5.0 Improvements and fixes
        • 9.4.0 Bugfixes
        • 9.3.3. Improvements and fixes
        • 9.3.2 Major improvements
        • 9.3.1 Automatic cloud migration
        • 9.2.2.1 Bugfixes
        • 9.2.2 Improvements and fixes
        • 9.2.1.3 Compatibility changes for Jira 9.0.0
        • 9.2.1 Major improvements
        • 9.2.0 Improvements and fixes
        • 9.1.1 Improvements and fixes
        • 9.1.0.1 Alerting and other major new features
        • 9.0.2 Bugfixes, next step in deprecating the Classic Mail Handler
        • 9.0.1 Minor improvement and fixes
        • 9.0.0 Major improvements
        • 9.12.0 Improvement and fixes
        • 9.17 Improvements and Fixes
        • 9.18.0 Improvements and fixes
      • 8.1.x
        • 8.1.3 Classic handler is deprecated, timezone support, bug fixes
        • 8.1.2 Important bug fixes
        • 8.1.1 Microsoft 365 OAuth2, improvements and fixes
        • 8.1.0 Microsoft 365 OAuth2, improvements and fixes
      • Up to 8.0.6
Powered by GitBook
On this page
  • REST API
  • Send emails
  • Request Statistics
  • Request Email Items from the Audit Log
  • Queue Statistics
  • OSGi Component API

Was this helpful?

  1. Documentation
  2. Integrations

API - Integration with other services

Email This Issue provides two types of API components that makes it possible to integrate it with other addons or external services.

REST API

Send emails

The REST API is a RESTFul service method that will send emails.

Parameter

Value

REST path

$JIRA_BASE_URL/rest/jeti/1.0/email

Request Method

POST

Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

Request Body

Email parameters in JSON

Response

  • 200: if email is composed and sent successfully

  • 500: if an error occured while composing and sending the email

Request Body Json

Request Body must be a well formatted Json object with the following structure.

Request Body Json

{
"issue":"BD-1", 
"to":["joe@foocompany.com","admin","g:jira-administrators","r:10000"],
"cc":["mary@anothercompany.com", "o:lead", "o:watchers"],
"bcc":[],
"emailSubject":"This is the email's subject as if the user entered it",
"emailBody":"This is the email body",
"addAttachments":"ALL",
"emailTemplate":"Acknowledge Issue",
"emailOptions":
  {
  "addToWatchers":"true",
  "replyToMe":"true",
  "mailAsMe":"false",
  "addComments":"true",
  "suppressCommentEvent":"true", 
  "emailFormat":"text",
  "commentVisibility":"g:jira-administrators",
  "richHtml":"false"
  },
"payload":{"pay1":"val1"}
} 

Fields in the Json object are the following:

Important: Only the issue field is mandatory.

Field
Definition
Example

issue

Numeric ID of the issue, or Issue Key

10000 or TEST-1

to,cc,bcc

Array of recipients:

  • email addresses

  • Jira user names

  • Jira participants with prefix "o:"

  • group names with prefix "g:"

  • project role IDs with prefix "r:"

  • custom field IDs with prefix "cf:"

Participant examples:

  • o:me - current user

  • o:reporter - issue reporter

  • o:assignee - issue assignee

  • o:watchers - issue watchers

  • o:lead - project lead

Group examples:

  • g:jira-administrators

Role examples:

  • r:10000, where 10000 is the numeric ID of the role

Custom Field examples:

  • cf:customfield_10010

emailSubject

Email Subject

emailBody

Email Body

addAttachments

Specifies how to select issue attachments to be added to the email

Value is one of:

  • ALL: all issue attachments

  • NONE: none of the attachments

  • LATEST: newest version of all attachment

  • ADDED_LAST: most recently added attachments

emailTemplate

Email template ID or name, email will be generated using this template.

If not given, the template selected in the issue's Context will be used.

emailOptions

Email options to control various aspects of the email.

  • addToWatchers: if true, JETI will add email user recipients as watchers of the issue

  • replyToMe: if true, JETI will set the current user's email address as the Reply-To header in the email

  • mailAsMe: if true, JETI will set the current user's email address as the From Address in the email

  • addComments: if true, JETI will add a comment to the issue.

  • suppressComment: if true, JETI will not fire an Issue Commented event

  • commentVisibility: if provided, JETI will secure the comment it adds to the issue.

  • richHtml: if true, JETI will interpret emailBody as a HTML content

payload

Key-Value map of values that will be added to the Velocity Context used to generate email body.

Email template may refer to these values and may render them in the email.

Request Statistics

The REST API is a RESTFul service method that will return the number of email items from the audit log.

Parameter

Value

REST path

$JIRA_BASE_URL/rest/jeti/1.0/email/stat

Request Method

GET

Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

See details in the

Query Parameters

Response Codes

  • 200: if email is composed and sent successfully

  • 500: if an error occurred while composing and sending the email

  • 401: if the calling user account is not authorized to request the details

Response Data

Number of mail items matching the query

Example

http://JIRA_URL/rest/jeti/1.0/email/stat?issueKey=<issue key>

Request Email Items from the Audit Log

The REST API is a RESTFul service method that will return email items from the audit log matching the query parameters.

Parameter

Value

REST path

$JIRA_BASE_URL/rest/jeti/1.0/email/query

Request Method

GET

Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

Authorization

Only those users may query the email items who are authorized to view them in the issue.

Query Parameters

Response Codes

  • 200: if email is composed and sent successfully

  • 500: if an error occurred while composing and sending the email

  • 401: if the calling user account is not authorized to request the details

Response Data

JSON Array of email items matching the query

Example

http://JIRA_URL/rest/jeti/1.0/email/query?issueKey=<issue key>

Response structure

[
{
"issueId": 22900,
"subject": "(IT-349) Új request by customer \"Hello WORLD\"",
"body": <email body>,
"to": <to recipients>,
"cc":<cc recipients>,
"from": <sender email address>,
"format": <email format>,
"actorUserKey": <user key>,
"type": <type of email item>,
"source": <trigger of the email>,
"date": <date and time the email was sent or processed>
},]

Queue Statistics

SINCE 9.0.0

Incoming Queue Statistics

Parameter
Value

REST path

$JIRA_BASE_URL/rest/jeti/1.0/incomingMailQueue/statistic

Request Method

GET

Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

Response Codes

  • 200: if email is composed and sent successfully

  • 500: if an error occurred while composing and sending the email

  • 401: if the calling user account is not authorized to request the details

Response Data

Returns statistics of the incoming mail queue.

Outgoing Queue Statistics

Parameter
Value

REST path

$JIRA_BASE_URL/rest/jeti/1.0/outgoingMailQueue/statistic

Request Method

GET

Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

Response Codes

  • 200: if email is composed and sent successfully

  • 500: if an error occurred while composing and sending the email

  • 401: if the calling user account is not authorized to request the details

Response Data

Returns statistics of the outgoing mail queue

Mail Generation Queue

Parameter
Value

REST path

$JIRA_BASE_URL/rest/jeti/1.0/mailGenerationQueue/statistic

Request Method

GET

Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

Response Codes

  • 200: if email is composed and sent successfully

  • 500: if an error occurred while composing and sending the email

  • 401: if the calling user account is not authorized to request the details

Response Data

Returns statistics of the mail generation queue.

OSGi Component API

In case, your Jira add-on wants to use Jira Email This Issue's email capabilities, you can build an integration between your add-on and Email This Issue. In order to do that you have to import the OSGi component Email This Issue publishes and call its methods.

API
Explanation

Component interface

Component method

Component method

Email Parameters

public class EmailDefinitionApi {
    private String issue;

    private List<String> to; //user keys and email addresses
    private List<String> cc; //user keys and email addresses
    private List<String> bcc; //user keys and email addresses
    private com.metainf.jira.plugin.emailissue.action.EmailOptions emailOptions;
    private String emailBody; //email body (will be injected in the template)
    private String emailSubject; //email subject (will be injected in the subject part of the template)

    private List<String> attachments; //issue attachment IDs
    private String addAttachments;
    private String emailTemplate; //name or ID of the Email template to use
    private Map<String, Object> payload; //arbitrary values that are injected into the Velocity Context in the template
}

public class EmailOptions {
	private boolean addToWatchers; //add recipient users to watchers, default: false
  	private boolean replyToMe; //set the current user as the reply-to address, default: false
  	private boolean mailAsMe; //set the sender address to the current user's email address, default: false
  	private String emailFormat; //email format "text" or "html"
  	private String emailPriority; //HIGH, NORMAL, LOW
}

public class EmailLogQuery {
	private Long issueId;
	private String issueKey;
	private String type; //EmailType
	private String source;
	private int top;
	private Date from;
	private Date to;
}

PreviousGlass DocumentationNextAdministration

Last updated 3 months ago

Was this helpful?

See details in the .

See details in the .

See details in the .

See details in the .

See details in the .

🤓
"emailOptions":
  {
  "addToWatchers":"true",
  "replyToMe":"true",
  "mailAsMe":"false",
  "addComments":"true",
  "suppressCommentEvent":"true", 
  "emailFormat":"text",
  "commentVisibility":"g:jira-administrators",
  "richHtml":"false"
  }
issueKey - Key of the issue whose email audit log is queried
issueId - Id of the issue whose email audit log is queried
mailHandlerId - ID of the Email This Issue Mail Handler to limit the query to incoming emails processed by this handler
type - Type of the email items to query (either of OUTGOING, INCOMING_ISSUE, INCOMING_COMMENT)
issueKey - Key of the issue whose email audit log is queried
issueId - Id of the issue whose email audit log is queried
limit- Limit the number of email items to return (max 1000)
type - Type of the email items to query (either of OUTGOING, INCOMING_ISSUE, INCOMING_COMMENT)
from - Date emails were sent or processed after (required format is dd/MM/yyyy)
to - Date emails were sent or processed before (required format is dd/MM/yyyy)
source - Trigger of the outgoing email (either of OPERATION, BULK, EVENT, WORKFLOW, AUTOREPLY, TEST, API, PREVIEW)
{
"new":<number of items with status NEW>,
"failed":<number of items with status FAILED>,
"skipped":<number of items with status SKIPPED>,
"processing":<number of items with status PROCESSING>
}
{
"active":<number of items with status ACTIVE>,
"error":<number of items with status ERROR>
}
{
"totalQueued":<total number of events that was ever queued>,
"totalCompleted":<total number of events completed>,
"currentlyOnQueue":<total number of events currently on queue>,
"activeWorkerThreads":<total number of active worker threads>,
"maxWorkerThreads":<max number of worker threads>,
"avgTimeInQueue":<average amount of time (ms) events spend on the queue>,
"maxQueueSize":<maximum number of events on the queue>
}
com.metainf.jira.plugin.emailissue.api.EmailService
void sendEmail(com.metainf.jira.plugin.emailissue.api.EmailDefinitionApi emailDefinition) throws Exception
Collection<EmailLog> queryEmailLog(com.metainf.jira.plugin.emailissue.api.EmailLogQuery emailLogQuery) throws Exception
documentation
documentation
documentation
documentation
documentation