API - Integration with other services
SINCE VERSION 6.3.0.9/7.0.9
This is an old documentation
This documentation page is valid upto version 7.0.28 of Email This Issue.
For 7.1 and later versions, the documentation is in a new location.
Email This Issue provides two types of API components that makes it possible to integrate it with other addons or external services.
REST API
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 See details in the documentation |
Request Body | Email parameters in JSON |
Response |
|
Request Body Json
Request Body must be a well formatted Json object with the following structure.
FIelds in the Json object is explained below.
Field | Mandatory | Explanation | Example |
---|---|---|---|
issue | ![]() | Numberic ID of the issue, or Issue Key | 10000 or TEST-1 |
to,cc,bcc | Array of recipients:
| Participant examples:
Group examples:
Role exmaples:
Custom Field examples:
| |
emailSubject | Email Subject | ||
emailBody | Email Body | ||
addAttachments | Specifies how to select issue attachments to be added to the email
| Value is one of:
| |
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.
| "emailOptions": { "addToWatchers":"true", "replyToMe":"true", "mailAsMe":"false", "addComments":"true", "suppressCommentEvent":"true", "emailFormat":"text", "commentVisibility":"g:jira-administrators", "richHtml":"false" } | |
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. |
OSGi Component
In case, your JIRA add-on want to use JETI's email capabilities, you can build an integration between your add-on and Email This Issue.
Simply import the OSGi component Email This Issue publishes and call its methods.
API | Explanation |
---|---|
Component interface | com.metainf.jira.plugin.emailissue.api.EmailService |
Component method | void sendEmail(EmailDefinitionApi emailDefinition) throws Exception |
Email parameters | com.metainf.jira.plugin.emailissue.api.EmailDefinitionApi |
Email Parameters
public class EmailDefinitionApi { private String issue; private List<String> to; private List<String> cc; private List<String> bcc; private EmailOptions emailOptions; private String emailBody; private String emailSubject; private List<String> attachments; private String addAttachments; private String emailTemplate; private Map<String, Object> payload; }