Skip to main content
Skip table of contents

Issue and current User Velocity variables

Where is that useful ?

The velocity language can be used to set an advanced field mapping. It allows the user to build a deeper and more custom configuration of an Elements copy & sync operation.

This page gives the whole list of velocity variables that can be used.

Velocity functionnalities

Syntax

Description

#if (condition) ... #elseif (condition) ... #else ... #end

Builds conditions

#set ($var = "whatever")

Sets an auxiliary variable

Velocity variables

Raw values

Syntax

Description

$exocetResolver.getValue($issue, "customfield_XXXXX")


OR


$exocetResolver.getValue($issue, "customfield_name")

Retrieves a string representation of the custom field's content.

XXXXX is the id of the custom field

Notes:

If the custom field value is an issue (ie: Epic link), the Elements Copy & Sync resolver will return the issue.

If the custom field has not value or does not exist, the resolver will return an empty string

If the custom field is an Elements Connect field, the resolver will return the JSON (or XML for Elements Connect v5) stored in database. Use this syntax for Elements Connect field to Elements Connect field mapping.

$exocetResolver.getValue($issue, "customfield_XXXXX.display")


OR


$exocetResolver.getValue($issue, "customfield_name.display")

Retrieves the display content of an Elements Connect field as a string. Use this suffix in a JIRA field mapping when the target field is not an Elements Connect field.

$exocetResolver.asMultipleValues("A, B")


OR


$exocetResolver.asMultipleValues("A|B", "|")

Retrieves the content from the first parameter and populates the multi-value target field (checkbox option, users, groups, labels, etc.).

The optional second parameter is the custom delimiter. By default, the delimiter is “, “.

$issue.id

Retrieves the issue id

$issue.key

Retrieves the issue key

$issue.summary

Retrieves the issue summary

$issue.description

Retrieves the issue description

$issue.environment

Retrieves issue environment

$issue.originalEstimate

Retrieves the original estimate (in seconds)

$issue.estimate

Retrieves the estimated remaining time (in seconds)

$issue.timeSpent

Retrieves the time spent on issue (in seconds)

$issue.components

Retrieves a JSON table of the component list:

Click here to expand...


CODE
[
	ProjectComponentImpl {
		name='component_name',
		description='component_description',
		lead='component_lead',
		assigneeType='assignee_type',
		projectId='project_id',
		id='component_id'
	},
	ProjectComponentImpl {
		...
	}
	...
]



$issue.affectedVersions

Retrieves a table of the affected versions:

Click here to expand...


CODE
[version_name1,version_name2, ...]



$issue.fixVersions

Retrieves a table of the fix versions:


Click here to expand...


CODE
[version_name1,version_name2, ...]



$currentUser

The user currently logged in. Its type is the same as $issue.reporter or any other issue actor.

$dateResolver.toDateFormat($yourDate)

Retrieves $yourDate formatted like "dd/MM/yyyy".

$dateResolver.toDateTimeFormat($yourDate)

Retrieves $yourDate formatted like "dd MMM yyyy hh:mm".

Named values

Syntax

Description

$issue.issueType.name // $issue.issueType.id

Retrieves issue type name or id

$issue.priority.name // $issue.priority.id

Retrieves issue priotrity name or id

$issue.resolution.name // $issue.resolution.id

Retrieves issue resolution name or id

$issue.status.name // $issue.status.id

Retrieves issue status name or id

User values

Syntax

Description

$issue.reporter.displayName // $issue.reporter.id

Retrieves issue reporter name or id

$issue.assignee.displayName // $issue.assignee.id

Retrieves issue assignee name or id

$currentUser.displayName // $currentUser.id //
$currentUser.emailAddress 

Retrieves current user name, id or emailAddress

Date values

The following variables return a string formatted as the following example: 2016-07-13 11:45:13.376.

Syntax

Description

$issue.created

Retrieves the issue creation date

$issue.updated

Retrieves the issue updated date

$issue.dueDate

Retrieves the issue due date

$issue.resolutionDate

Retrieves the issue resolution date

$dateResolver.addDays($yourDate, "X")


OR


$dateResolver.addDays($yourDate, "-X")

Retrieves a date with additional X days ("-" to remove days)

(info) For now, only works with System fields (such as $issue.created) and not with custom fields.

$dateResolver.addMonths($yourDate, "X")


OR


$dateResolver.addMonths($yourDate, "-X")

Retrieves a date with additional X months ("-" to remove months)

(info) For now, only works with System fields (such as $issue.created) and not with custom fields.

$dateResolver.addYears($yourDate, "X")


OR


$dateResolver.addYears($yourDate, "-X")

Retrieves a date with additional X years ("-" to remove years)

(info) For now, only works with System fields (such as $issue.created) and not with custom fields.

$dateResolver.addHours($yourDate, "X")


OR


$dateResolver.addHours($yourDate, "-X")

Retrieves a date with additional X hours ("-" to remove hours)

(info) For now, only works with System fields (such as $issue.created) and not with custom fields.

$dateResolver.addMinutes($yourDate, "X")


OR


$dateResolver.addMinutes($yourDate, "-X")

Retrieves a date with additional X minutes ("-" to remove minutes)

(info) For now, only works with System fields (such as $issue.created) and not with custom fields.

$dateResolver.addSeconds($yourDate, "X")


OR


$dateResolver.addSeconds($yourDate, "-X")

Retrieves a date with additional X seconds ("-" to remove seconds)

(info) For now, only works with System fields (such as $issue.created) and not with custom fields.

Project values

Syntax

Description

$issue.project.key

Retrieves the project key

$issue.project.name

Retrieves the project name

$issue.project.id

Retrieves the project id

$issue.project.lead

Retrieves the project lead


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.