public interface IJEMHVelocityContextUtils
Modifier and Type | Interface and Description |
---|---|
static class |
IJEMHVelocityContextUtils.InlineImageEncodingType |
Modifier and Type | Field and Description |
---|---|
static String |
ADDITIONAL_ATTACHMENTS |
static String |
ADDITIONAL_CC |
static String |
ADDITIONAL_TO |
static String |
X_JEMH_ADHOC_PREFIX
used to prefix mail header keys themselves, used to avoid conflicts for issue attributes
|
static String |
X_JEMH_RAW_PREFIX
unlike the above, this is only used to uniquely store 'raw' mail headers in the 'map' prior to application
|
Modifier and Type | Method and Description |
---|---|
void |
addMailHeader(String key,
String value)
Adds a mail header to the outgoing mail.
|
void |
addRawMailHeader(String key,
String value)
Adds a mail header that is not prefixed.
|
void |
addRecipientAddress(String recipientType,
String addressCsv)
Adds recipients through CSV SMTP address
|
void |
addRecipientGroup(String recipientType,
String groupName)
Adds recipients from a given Jira group
|
void |
addRecipientsFromRole(String recipientType,
String issueKey,
com.atlassian.jira.project.Project project,
String roleName)
Add recipients based on Role membership
|
String |
addStaticResourceAttachment(Integer id)
Add a global (unscoped) static resource by its Id.
|
String |
addStaticResourceAttachment(com.atlassian.jira.project.Project project,
Integer id)
Add a static resource (scoped to project) by its Id
|
Map<String,Object> |
createResultSet()
Enable scripts to create multiple issue,by creating an additional (possibly many) new result sets containing key/value paris as usual
|
void |
dropMessage(String reason)
During Script Field Processor handling of a message, allows a given message to be dropped immediately with no further processing
|
void |
filterMessage(String reason)
During Script Field Processor handling of a message, allows a given message to not be processed but filtered (like drop), here for completeness and differentation to drop
|
String |
filterText(String text) |
void |
forwardMessage(String reason)
During Script Field Processor handling of a message, allows a given message to not be processed but forwarded to the Profile defined 'Forward' user
|
String |
getCalData()
Get the content of the text/calendar message part
|
javax.mail.internet.InternetAddress |
getCatchEmailAddress() |
Properties |
getCommentProperties(com.atlassian.jira.issue.comments.Comment comment)
Get comment properties
|
Map<String,Integer> |
getImageCidMap()
Internal use
|
String |
getInhibitSendingReason()
Gets the reason that was possibly set by the processing script why this message was inhibited for sending
|
IJEMHLdapVelocityContextUtil |
getLdap()
Create an Ldap helper that enables querying through LDAP configurations selected in the Profile
|
com.atlassian.jira.util.I18nHelper |
getLocaleI18nBean(String localeIn)
Get a specific locale i18n helper
|
String |
getMessageBody(javax.mail.Message message)
Get the body (according to htmL to wiki conversion configuration in the Profile)
|
String |
getMessagePartText(String contentType) |
List<javax.mail.Message> |
getMessageSubParts(javax.mail.internet.MimeMessage parentMessage)
Get the child attachment Parts that are message/rfc822
|
Map<String,List<String>> |
getParams()
Accessor for Map of value keys to list of values
|
IJEMHMessageFilterProvider.ProcessOutcome |
getProcessOutcome()
Accessor method to get script driven outcome of message processing that would override future processing/outcome.
|
String |
getRejectReason()
Get the message that may be set to describe why a message was rejected, ends up in audit record.
|
Collection<Map<String,Object>> |
getResultSets()
Accessor method to expose any additional ResultSets created by the script
|
TimeZone |
getTimeZone(String location) |
URI |
getUserAvatarURL(com.atlassian.jira.user.ApplicationUser user,
int size)
Enable the URI of a user avatar to be retrieved for inlining
|
com.atlassian.jira.user.ApplicationUser |
getUserByEmail(javax.mail.internet.InternetAddress address)
Helper method to get a User
|
com.atlassian.jira.user.ApplicationUser |
getUserByEmail(String emailStr)
Helper method to bet a User
|
String |
hash(String stringToEncrypt)
Function to allow hashing of arbitrary content, eg summary, eg description, for storing in custom fields, to potentially detect future resends of same content/description even after the initial issue was edited
|
com.atlassian.jira.util.json.JSONObject |
invokeLocalAnonRest(String path)
Make an anonymous HTTP request relative to the local Jira path
|
com.atlassian.jira.util.json.JSONObject |
invokeLocalRest(String path)
Make a HTTP request relative to the local Jira path
|
boolean |
isCustomFieldChanged(com.atlassian.jira.event.issue.IssueEvent issueEvent,
String cfId)
Used to determine during outbound processing, whether the given custom field id was in a ChildChangeItem of the event
|
boolean |
isInhibitSending()
determine if the outcome of the script is to inhibit sending of 'this' notification
|
boolean |
isPrivateJSDComment(com.atlassian.jira.user.ApplicationUser contextUser,
com.atlassian.jira.issue.comments.Comment c)
Helper method to determine if a comment is JSD private
|
boolean |
isPrivateJSDComment(com.atlassian.jira.mail.TemplateUser contextTemplateUser,
com.atlassian.jira.issue.comments.Comment c)
Helper method to determine if a comment is JSD private, which is required during actual mail sending
|
void |
log(String msg)
Log an INFO message to the JEMH log file
|
void |
log(String level,
String msg)
Output a message to the JEMH log file
|
void |
rejectMessage(String reason)
During Script Field Processor handling of a message, allows a given message to be rejected to the initator, with the given reason
|
String |
renderStaticResourceImage(Integer id)
Render a given static resource image (unscoped) inline.
|
String |
renderStaticResourceImage(com.atlassian.jira.project.Project project,
Integer id)
Render a given static resource image (scoped to the given project) inline.
|
String |
renderStaticResourceImage(com.atlassian.jira.project.Project project,
Integer id,
String type)
Render a given static resource image (scoped to the given project) inline.
|
com.atlassian.jira.util.json.JSONObject |
request(Map<String,Object> options)
Perform a custom HTTP request
|
void |
setInhibitSending(boolean val)
Used during sending messages to inhibit sending, specifically needed due to split phase issue creation/update to enable ignoring ISSUE_CREATED events when JEMH has not yet added attachments to the issue, that are potentially required later.
|
void |
setInhibitSendingReason(String reason)
Sets a reason, retained in the audit entry to indicate why this message was inhibited for sending
|
String |
urlencode(String incoming)
Helper method to urlencode(UTF-8) a string in Java context:
|
static final String X_JEMH_ADHOC_PREFIX
static final String X_JEMH_RAW_PREFIX
static final String ADDITIONAL_TO
static final String ADDITIONAL_CC
static final String ADDITIONAL_ATTACHMENTS
String getCalData()
TimeZone getTimeZone(String location)
location
- for which the timeZone is neededjavax.mail.internet.InternetAddress getCatchEmailAddress()
String filterText(String text)
text
- to Filters the input text through some Mime decodingvoid setInhibitSending(boolean val)
val,
- true to inhibitboolean isInhibitSending()
void setInhibitSendingReason(String reason)
reason
- as textString getInhibitSendingReason()
boolean isPrivateJSDComment(com.atlassian.jira.user.ApplicationUser contextUser, com.atlassian.jira.issue.comments.Comment c)
contextUser,
- the context for the questionc,
- related commentboolean isPrivateJSDComment(com.atlassian.jira.mail.TemplateUser contextTemplateUser, com.atlassian.jira.issue.comments.Comment c)
contextTemplateUser,
- the contextTemplateUser for the questionc,
- related commentProperties getCommentProperties(com.atlassian.jira.issue.comments.Comment comment)
comment
- to get properties ofvoid addMailHeader(String key, String value)
key
- text, all spaces in the value are removed, the result is prefixed by X-JEMH-ADHOC-value
- text, should be relatively short. We don't wrap or encode the data suppliedvoid addRawMailHeader(String key, String value)
key,
- usually of format X-something-elsevalue,
- text, should be relatively short. We don't wrap or encode the data suppliedvoid addRecipientsFromRole(String recipientType, String issueKey, com.atlassian.jira.project.Project project, String roleName)
issueKey
- eg ABC-123project
- from the issueroleName
- eg "Customers"recipientType
- eg "to" or "cc" (only)void addRecipientAddress(String recipientType, String addressCsv)
recipientType,
- valid values are to and ccaddressCsv,
- valid values are of format user@domain.com, NO Name parts are supported.void addRecipientGroup(String recipientType, String groupName)
recipientType,
- valid values are to and ccgroupName
- of Jira groupMap<String,List<String>> getParams()
com.atlassian.jira.user.ApplicationUser getUserByEmail(javax.mail.internet.InternetAddress address)
address
- of the user as an InternetAddress objectcom.atlassian.jira.user.ApplicationUser getUserByEmail(String emailStr)
emailStr
- of the user as text in format user@domain.com, no Name part is supported.void dropMessage(String reason)
reason,
- a non empty value used in auditingvoid forwardMessage(String reason)
reason,
- a non empty value used in auditingvoid filterMessage(String reason)
reason,
- a non empty value used in auditingvoid rejectMessage(String reason)
reason,
- a non empty value used in auditingIJEMHMessageFilterProvider.ProcessOutcome getProcessOutcome()
String getRejectReason()
com.atlassian.jira.util.I18nHelper getLocaleI18nBean(String localeIn)
localeIn
- the localeString addStaticResourceAttachment(Integer id)
id,
- numeric ID of the Static ResourceString addStaticResourceAttachment(com.atlassian.jira.project.Project project, Integer id)
project,
- the project in which the Static Resource has been scopedid,
- numeric ID of the Static ResourceString renderStaticResourceImage(Integer id)
id,
- numeric ID of the Static ResourceString renderStaticResourceImage(com.atlassian.jira.project.Project project, Integer id)
project,
- the project in which the Static Resource image is scopedid,
- numeric ID of the Static ResourceString renderStaticResourceImage(com.atlassian.jira.project.Project project, Integer id, String type)
project,
- the project in which the Static Resource image is scopedid,
- numeric ID of the Static Resourcetype,
- "cid" is the new default, "base64" (inline encoded data) is also validMap<String,Integer> getImageCidMap()
boolean isCustomFieldChanged(com.atlassian.jira.event.issue.IssueEvent issueEvent, String cfId)
issueEvent
- involvedcfId,
- custom field id, of format, customfield_12345String urlencode(String incoming)
incoming
- valuecom.atlassian.jira.util.json.JSONObject request(Map<String,Object> options)
options
- a Map
containing the configuration options for this HTTP request
String
- the absolute (full) request URLString
- the request method to use. GET is default.String
- username of the user to perform the request asString
or Integer
- connection timeout in millisecondsString
- JSON data for request body. Appended to URL for GET requests. In JavaScript
JSON.stringify(data)can be used to convert JSON/Object to String
JSONObject
containing the responsecom.atlassian.jira.util.json.JSONObject invokeLocalRest(String path)
path
- of local rest call, relative to Jira's base URLJSONObject
containing the response body (if present)com.atlassian.jira.util.json.JSONObject invokeLocalAnonRest(String path) throws com.atlassian.jira.util.json.JSONException
path
- of local rest call, relative to Jira's base URLJSONObject
containing the response body (if present)com.atlassian.jira.util.json.JSONException
- if it breaksString hash(String stringToEncrypt) throws NoSuchAlgorithmException, UnsupportedEncodingException
stringToEncrypt
- eg summary / bodyNoSuchAlgorithmException
- if it breaksUnsupportedEncodingException
- if it breaksMap<String,Object> createResultSet()
Collection<Map<String,Object>> getResultSets()
void log(String level, String msg)
level
- the log level for the output: DEBUG, INFO, WARN, ERRORmsg
- the message to logvoid log(String msg)
msg
- the message to logList<javax.mail.Message> getMessageSubParts(javax.mail.internet.MimeMessage parentMessage)
parentMessage
- the Mime messageString getMessageBody(javax.mail.Message message)
message
- sourceIJEMHLdapVelocityContextUtil getLdap()
URI getUserAvatarURL(com.atlassian.jira.user.ApplicationUser user, int size)
user
- size
- Copyright © 2008–2020 The Plugin People. All rights reserved.