# API for Velocity Context Objects - 1.7

Velocity Context offers many objects for templates. Find the list of variables with explanations here: [Customizable Email Templates](https://docs.meta-inf.hu/email-this-issue/outgoing-emails/email-this-issue-for-jira-cloud-customizable-email-templates).

Below is the detailed description of object attributes. You can render the attributes in the templates in the format of *$!variable.attribute*

* [User](#apiforvelocitycontextobjects-1.7-user)
* [Issue](#apiforvelocitycontextobjects-1.7-issue)
  * [Attributes](#apiforvelocitycontextobjects-1.7-attributes)
  * [Methods](#apiforvelocitycontextobjects-1.7-methods)
* [IssueEvent](#apiforvelocitycontextobjects-1.7-issueevent)
* [Comment](#apiforvelocitycontextobjects-1.7-comment)
* [Changelog](#apiforvelocitycontextobjects-1.7-changelog)
* [ChangelogItem](#apiforvelocitycontextobjects-1.7-changelogitem)
* [Worklog](#apiforvelocitycontextobjects-1.7-worklog)
* [EmailCommand](#apiforvelocitycontextobjects-1.7-emailcommand)
* [Template Support](#apiforvelocitycontextobjects-1.7-templatesupport)
* [Project](#apiforvelocitycontextobjects-1.7-project)
* [IssueType](#apiforvelocitycontextobjects-1.7-issuetype)
* [Status](#apiforvelocitycontextobjects-1.7-status)
* [Priority](#apiforvelocitycontextobjects-1.7-priority)
* [Resolution](#apiforvelocitycontextobjects-1.7-resolution)
* [Timetracking](#apiforvelocitycontextobjects-1.7-timetracking)
* [Attachment](#apiforvelocitycontextobjects-1.7-attachment)
* [Component](#apiforvelocitycontextobjects-1.7-component)
* [Version](#apiforvelocitycontextobjects-1.7-version)
* [CustomFieldValue](#apiforvelocitycontextobjects-1.7-customfieldvalue)
* [CustomField](#apiforvelocitycontextobjects-1.7-customfield)
* [FieldValue\<T>](#apiforvelocitycontextobjects-1.7-fieldvalue-less-than-t-greater-than)

## User <a href="#apiforvelocitycontextobjects-1.7-user" id="apiforvelocitycontextobjects-1.7-user"></a>

| Attribute Name | Type    | Description                                         |
| -------------- | ------- | --------------------------------------------------- |
|                | String  | Internal key of the user it is unique to the users. |
|                | String  | Loginname of the user                               |
|                | String  | Email address of the user                           |
|                | String  | Display name of the user                            |
|                | boolean | true if the user account is active in Jira          |
|                | String  | URLs to user avatars in different sizes.            |

## Issue <a href="#apiforvelocitycontextobjects-1.7-issue" id="apiforvelocitycontextobjects-1.7-issue"></a>

### Attributes <a href="#apiforvelocitycontextobjects-1.7-attributes" id="apiforvelocitycontextobjects-1.7-attributes"></a>

| Attribute Name  | Type                          | Description                                                                                                                     |
| --------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| id              | number                        | Internal ID of the issue                                                                                                        |
| key             | String                        | Unique Issue Key                                                                                                                |
| summary         | String                        | Issue summary                                                                                                                   |
| description     | FieldValue\<String>           | Issue Description field with raw value and rendered format                                                                      |
| environment     | FieldValue\<String>           | Issue Environment field with raw value and rendered format                                                                      |
| project         | Project                       | Project of the issue                                                                                                            |
| issueType       | IssueType                     | Type of the issue                                                                                                               |
| status          | Status                        | Issue status                                                                                                                    |
| resolution      | Resolution                    | Resolution of the issue                                                                                                         |
| priority        | Priority                      | Priority of the issue                                                                                                           |
| timetracking    | Timetracking                  | Timetracking details of the issue                                                                                               |
| creator         | User                          | Creator of the issue. The Creater may be different from the Reporter as privileged users may create issues on behalf of others. |
| reporter        | User                          | The user set as Reporter in the issue.                                                                                          |
| assignee        | User                          | Current assignee.                                                                                                               |
| created         | FieldValue\<Date>             | Issue Created date field value with raw value and rendered format.                                                              |
| updated         | FieldValue\<Date>             | Issue Updated date field value with raw value and rendered format.                                                              |
| resolutionDate  | FieldValue\<Date>             | Issue Resolution date field value with raw value and rendered format.                                                           |
| dueDate         | FieldValue\<Date>             | Issue Due Date field value with raw value and rendered format.                                                                  |
| customFields    | Collection\<CustomFieldValue> |                                                                                                                                 |
| comments        | Collection\<Comment>          |                                                                                                                                 |
| attachments     | Collection\<Attachment>       |                                                                                                                                 |
| components      | Collection\<Component>        |                                                                                                                                 |
| fixVersions     | Collection\<Version>          |                                                                                                                                 |
| affectsVersions | Collection\<Version>          |                                                                                                                                 |
| labels          | Collection\<String>           |                                                                                                                                 |

### Methods <a href="#apiforvelocitycontextobjects-1.7-methods" id="apiforvelocitycontextobjects-1.7-methods"></a>

| Signature                           | Return type      | Parameters                                                | Description                                                                                                                                                                                                                                                                                    | Example                                           |
| ----------------------------------- | ---------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| getCustomFieldValue(customFieldKey) | CustomFieldValue | <ul><li>customFieldKey: key of the custom field</li></ul> | Returns a [API for Velocity Context Objects](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api/email-this-issue-for-jira-cloud-api-for-velocity-context-objects) - CustomFieldValue object representing the value of the custom field addressed by the key | $!issue.getCustomFieldValue('customfield\_10116') |

## IssueEvent <a href="#apiforvelocitycontextobjects-1.7-issueevent" id="apiforvelocitycontextobjects-1.7-issueevent"></a>

| Attribute Name | Type                                                                                                                                                                                                    | Description                                                                  |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| eventType      |                                                                                                                                                                                                         | The type of the triggered event.(eg. issue created, issue commented, ...)    |
| issue          | [API for Velocity Context Objects#Issue](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api-for-velocity-context-objects#apiforvelocitycontextobjects-issue)         | The Issue which the event was fired on.                                      |
| changelog      | [API for Velocity Context Objects#Changelog](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api-for-velocity-context-objects#apiforvelocitycontextobjects-changelog) |                                                                              |
| worklog        | [API for Velocity Context Objects#Worklog](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api-for-velocity-context-objects#apiforvelocitycontextobjects-worklog)     |                                                                              |
| comment        | [API for Velocity Context Objects#Comment](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api-for-velocity-context-objects#apiforvelocitycontextobjects-comment)     |                                                                              |
| timestamp      | Date                                                                                                                                                                                                    | The time when the issue was triggered                                        |
| user           | [API for Velocity Context Objects#User](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api-for-velocity-context-objects#apiforvelocitycontextobjects-user)           | The user who triggered the event (added the comment, updated the issue, ...) |

## Comment <a href="#apiforvelocitycontextobjects-1.7-comment" id="apiforvelocitycontextobjects-1.7-comment"></a>

| Attribute Name             | Type                | Description                  |
| -------------------------- | ------------------- | ---------------------------- |
| id                         | Number              | Internal ID of the comment   |
| author                     | User                | Author of the comment        |
| updateAuthor               | User                | Update author of the comment |
| body                       | FieldValue\<String> | Comment body                 |
| created                    | FieldValue\<Date>   | Creation date                |
| updated                    | FieldValue\<Date>   | Update date                  |
| limitedVisibility          | boolean             |                              |
| internalServiceDeskComment | boolean             |                              |
| publicServiceDeskComment   | boolean             |                              |

## Changelog <a href="#apiforvelocitycontextobjects-1.7-changelog" id="apiforvelocitycontextobjects-1.7-changelog"></a>

| Attribute Name | Type                                                                                                                                                                                                                  | Description               |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| items          | List<[API for Velocity Context Objects#ChangelogItem](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api-for-velocity-context-objects#apiforvelocitycontextobjects-changelogitem)> | A list of Changelog items |

## ChangelogItem <a href="#apiforvelocitycontextobjects-1.7-changelogitem" id="apiforvelocitycontextobjects-1.7-changelogitem"></a>

| Attribute Name | Type | Description |
| -------------- | ---- | ----------- |
| created        |      |             |
| field          |      |             |
| fieldId        |      |             |
| fieldType      |      |             |
| from           |      |             |
| fromString     |      |             |
| to             |      |             |
| toString       |      |             |

## Worklog <a href="#apiforvelocitycontextobjects-1.7-worklog" id="apiforvelocitycontextobjects-1.7-worklog"></a>

| Attribute Name   | Type                                                                                                                                                                              | Description                           |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| author           | [API for Velocity Context Objects#User](https://metainf.atlassian.net/wiki/pages/resumedraft.action?draftId=49512456#APIforVelocityContextObjects-User)                           | Author of the worklog                 |
| comment          | [FieldValue](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api/email-this-issue-for-jira-cloud-api-for-velocity-context-objects-1.7)\<String> | The comment added to the worklog      |
| created          | [FieldValue](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api/email-this-issue-for-jira-cloud-api-for-velocity-context-objects-1.7)\<Date>   | The date when the worklog was created |
| issueId          | long                                                                                                                                                                              | Id of the issue                       |
| started          | [FieldValue](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api/email-this-issue-for-jira-cloud-api-for-velocity-context-objects-1.7)\<Date>   |                                       |
| timeSpent        | String                                                                                                                                                                            |                                       |
| timeSpentSeconds | long                                                                                                                                                                              |                                       |
| visibilityType   | String                                                                                                                                                                            |                                       |
| visibilityValue  | String                                                                                                                                                                            |                                       |
| updateAuthor     | [API for Velocity Context Objects#User](https://metainf.atlassian.net/wiki/pages/resumedraft.action?draftId=49512456#APIforVelocityContextObjects-User)                           |                                       |
| updated          | [FieldValue](https://docs.meta-inf.hu/email-this-issue/general/email-this-issue-for-jira-cloud-api/email-this-issue-for-jira-cloud-api-for-velocity-context-objects-1.7)\<Date>   |                                       |

## EmailCommand <a href="#apiforvelocitycontextobjects-1.7-emailcommand" id="apiforvelocitycontextobjects-1.7-emailcommand"></a>

| Attribute Name | Type | Description |
| -------------- | ---- | ----------- |

## Template Support <a href="#apiforvelocitycontextobjects-1.7-templatesupport" id="apiforvelocitycontextobjects-1.7-templatesupport"></a>

| Attribute Name | Type    | Description                                                                 |
| -------------- | ------- | --------------------------------------------------------------------------- |
|                | boolean | Returns true if the given user is an agent on the project, otherwise false. |

## Project <a href="#apiforvelocitycontextobjects-1.7-project" id="apiforvelocitycontextobjects-1.7-project"></a>

| Attribute Name | Type | Description |
| -------------- | ---- | ----------- |

## IssueType <a href="#apiforvelocitycontextobjects-1.7-issuetype" id="apiforvelocitycontextobjects-1.7-issuetype"></a>

## Status <a href="#apiforvelocitycontextobjects-1.7-status" id="apiforvelocitycontextobjects-1.7-status"></a>

## Priority <a href="#apiforvelocitycontextobjects-1.7-priority" id="apiforvelocitycontextobjects-1.7-priority"></a>

## Resolution <a href="#apiforvelocitycontextobjects-1.7-resolution" id="apiforvelocitycontextobjects-1.7-resolution"></a>

## Timetracking <a href="#apiforvelocitycontextobjects-1.7-timetracking" id="apiforvelocitycontextobjects-1.7-timetracking"></a>

## Attachment <a href="#apiforvelocitycontextobjects-1.7-attachment" id="apiforvelocitycontextobjects-1.7-attachment"></a>

## Component <a href="#apiforvelocitycontextobjects-1.7-component" id="apiforvelocitycontextobjects-1.7-component"></a>

## Version <a href="#apiforvelocitycontextobjects-1.7-version" id="apiforvelocitycontextobjects-1.7-version"></a>

## CustomFieldValue <a href="#apiforvelocitycontextobjects-1.7-customfieldvalue" id="apiforvelocitycontextobjects-1.7-customfieldvalue"></a>

| Attribute Name | Type                                         | Description                                                                                                                                                                |
| -------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| customField    | API for Velocity Context Objects#CustomField | Reference to the CustomField                                                                                                                                               |
| renderedValue  | String                                       | The value in html as visible in Jira                                                                                                                                       |
| value          |                                              | <p>Contains the raw value of the field.</p><p>Type is the type of declared in Jira. One of</p><ul><li>Date</li><li>String</li><li>User</li><li>Collection\<User></li></ul> |

## CustomField <a href="#apiforvelocitycontextobjects-1.7-customfield" id="apiforvelocitycontextobjects-1.7-customfield"></a>

| Attribute Name | Type   | Description                                                                                                                                              |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| customId       | Long   |                                                                                                                                                          |
|                | String | <p>key of the custom field. This is the primary identifier used by Email This Issue. (eg. in macro parameters)</p><p>The format is customfield\_$id.</p> |
| itemType       | String |                                                                                                                                                          |
| type           | String |                                                                                                                                                          |

## FieldValue\<T> <a href="#apiforvelocitycontextobjects-1.7-fieldvalue-less-than-t-greater-than" id="apiforvelocitycontextobjects-1.7-fieldvalue-less-than-t-greater-than"></a>

| Attribute Name | Type   | Description                                                                                                                                                                |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| rawValue       | T      | <p>Contains the raw value of the field.</p><p>Type is the type of declared in Jira. One of</p><ul><li>Date</li><li>String</li><li>User</li><li>Collection\<User></li></ul> |
| renderedValue  | String | The value in html as visible in Jira                                                                                                                                       |
