Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

...

ParameterValue
REST path$JIRA_BASE_URL/rest/jeti/1.0/email/stat
Request MethodGET
Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

See details in the documentation

Query Parameters
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)
Response Codes
  • 200: if email is composed and sent successfully
  • 500: if an error occured while composing and sending the email
  • 401: if the calling user account is not authorized to request the details
Response DataNumber of mail items matching the query
Examplehttp://JIRA_URL/rest/jeti/1.0/email/stat?issueKey=<issue key>

...

ParameterValue
REST path$JIRA_BASE_URL/rest/jeti/1.0/email/query
Request MethodGET
Request Headers

Content-Type:application/json

Authentication

What Jira REST API offers

See details in the documentation

AuthorizationOnly those users may query the email items who are authorized to view them in the issue
Query Parameters
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)
Response Codes
  • 200: if email is composed and sent successfully
  • 500: if an error occured while composing and sending the email
  • 401: if the calling user account is not authorized to request the details 
Response DataJSON Array of email items matching the query
Examplehttp://JIRA_URL/rest/jeti/1.0/email/stat?issueKey=<issue key>

...

APIExplanation
Component interface
com.metainf.jira.plugin.emailissue.api.EmailService
Component method


Code Block
languagejava
void sendEmail(com.metainf.jira.plugin.emailissue.api.EmailDefinitionApi emailDefinition) throws Exception
Email parameters


Component method


Code Block
languagejava
Collection<EmailLog> queryEmailLog(com.metainf.jira.plugin.emailissue.api.
EmailDefinitionApi
EmailLogQuery emailLogQuery) throws Exception


Email Parameters

Code Block
languagejava
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;
}