Table of Contents |
---|
Summary
The Comment Header allows you to prefix specific content onto comments when they are processed by JEMHC.
Creating a
...
Content Header template
Comment header content is create and modified through the use of a template. Templates are found within Notification > Template Sets.
...
Information about the data available to you for use within a Template’s content can be found here.
Changing the Template that is used by the Profile
Once the template has been created you will then have to select the template within the Profile so that it will then be applied within the comment. To change the template you go to Profile > Project mapping > Templates and press Edit.
...
You will now be able to select the Comment Header Template that was just created.
...
Choose the sender categories this should apply to
Within the Profile you are also able to set when the Comment header Content Header should be applied whether you would the comment header to be applied for only and for the scope (email users and or for email users and Jira watchers. This configuration is found within Jira users). See Profile > Project Mapping > Issue > Comment > Comment Header Mode
...
Content Headers
Available options are:
Inherited
Don’t add header
Add header for email users
Add header for email users and Jira watchers
Headers are not added for Jira users/reporters as the ‘user’ object that creates the issue and/or comment clearly identifies who is making the comment.
...
Example Content Header
Once you have the comment header configured you will then see that new comments will have the new comment header applied.
...
Data available for use within a Template’s content (with usage examples)
The data available to you for use within your template can be found by expanding the Preview Context and Velocity Context sections.
...
This will allow you to see how your template will render when in use, given the example Preview Context shown on this section.
Preview Context data
...
Code Block |
---|
{
"from": "from@someUser.com",
"fromPersonal": "Johny User",
"recipients": [
"to@aUser.net",
"and@anotherUser.net",
"support@thisCompany.net"
],
"subject": "The subject",
"body": "This is the body with some i18n characters @Техническая проблема= some value",
"bodyFormat": "text",
"timestamp": 1552055974959,
"catchEmailAddresses": [
"support@thisCompany\\.net",
"support.*@anotherCompany\\.net"
],
"matchingRecipient": "support@thisCompany.net",
"matchingCatchEmailAddress": "support@thisCompany\\.net",
"isJiraUser": false
} |
Preview Context data is specific to the context in which your template is used and is available at render time. From the example above we can see that the context for an incoming email shows the address from which the email was sent, and the intended recipients.
...
Code Block |
---|
$context.from.textValue()
|
The email body will automatically be output after the contents of a template. The above template therefore results in the value of the sender’s email address being added to the top of all issue comments and newly created issue descriptions. This would then render as shown below, given the data shown in the example Preview Context.
...
Code Block |
---|
From: (mailto:$context.from.textValue()) with the subject $context.subject.
The email was sent to $context.recipients.size() recipients, one of whom
has the email address $context.recipients[0].textValue().
|
This would then render as shown below, given the data shown in the example Preview Context.
...
In the above example the recipients field has multiple entries surrounded by square braces. These data structures are called “arrays” and we can access each element by its positional index within the list as shown above with $context.recipients[0]
. The positional indices for arrays start at zero, therefore the first element is found at $context.recipients[0]
the second at $context.recipients[1]
, and so on.
Velocity Context data
...
Velocity Context data is also available to your template at render time but provides more general utilities for your use.
...
Code Block |
---|
$jemhDateUtils.nowDate()
|
This would then render as shown below given the data shown in the example Preview Context, and would show the date the comment was created.
...