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 successfully500
: 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
Fields in the Json object are the following:
Important: Only the issue field is mandatory.
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
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 successfully500
: if an error occurred while composing and sending the email401
: 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/stat?issueKey=<issue key>
Response structure
Queue Statistics
SINCE 9.0.0
Incoming Queue Statistics
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 successfully500
: if an error occurred while composing and sending the email401
: if the calling user account is not authorized to request the details
Response Data
Returns statistics of the incoming mail queue.
Outgoing Queue Statistics
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 successfully500
: if an error occurred while composing and sending the email401
: if the calling user account is not authorized to request the details
Response Data
Returns statistics of the outgoing mail queue
Mail Generation Queue
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 successfully500
: if an error occurred while composing and sending the email401
: 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.
Component interface
Component method
Component method
Email Parameters
Last updated