YouTrack Standalone 2017.2 Help

Project

Extends: BaseEntity

Represents a YouTrack project.

Properties

NameTypeDescriptionRead-only
description String The description of the project. Available in project administration UI. /help/img/youtrack/2017.2/checkbox-marked.png
fields Set.<ProjectCustomField> Custom fields configured for the project. /help/img/youtrack/2017.2/checkbox-marked.png
isArchived Boolean `true` in case the project is archived. /help/img/youtrack/2017.2/checkbox-marked.png
issues Set.<Issue> All issues of the project. /help/img/youtrack/2017.2/checkbox-marked.png
key String The key of the project. Use instead of project.shortName, which is deprecated. /help/img/youtrack/2017.2/checkbox-marked.png
leader User The leader of the project. Available in project administration UI. /help/img/youtrack/2017.2/checkbox-marked.png
name String The name of the project. /help/img/youtrack/2017.2/checkbox-marked.png
notificationEmail String The email address that is used to send notifications for the project.If a From address is not set for the project, the From address for the YouTrack server is returned.

if (issue.becomesReported) { var lastRelatedEmails = issue.fields['Last message related emails']; if (lastRelatedEmails) { lastRelatedEmails.split(' ').forEach(function (email) { if (email && email.equalsIgnoreCase(issue.project.notificationEmail)) { var allRelatedEmails = issue.fields['All related emails']; if (!allRelatedEmails) { issue.fields['All related emails'] = email; } else if (!(allRelatedEmails.split(' ').has(email))) { issue.fields['All related emails'] = allRelatedEmails + ' ' + email; } } }); issue.fields['Last message related emails'] = null; } }

/help/img/youtrack/2017.2/checkbox-marked.png

Methods

 

findByKey

static findByKey(key)

Finds a project by short name (id).

Parameters:

NameTypeDescription
key String The key to find by.

Returns:

TypeDescription
Project Project, or null in case no project exists with the provided short name.

 

findByName

static findByName(name)

Finds a project by name.

Parameters:

NameTypeDescription
name String name to find by.

Returns:

TypeDescription
Project project, or null in case no project exists with the provided name.

 

becomes

becomes(fieldName, expected)

Checks that a value a field receives in the current transaction is equal to an expected one.

Parameters:

NameTypeDescription
fieldName string name of the field to check.
expected string expected value.

Returns:

TypeDescription
boolean `true` in case the expectation is met.

 

canBeReadBy

canBeReadBy(fieldName, user)

Checks if a field can be read by a user.

Parameters:

NameTypeDescription
fieldName string name of the field.
user User to check access for.

Returns:

TypeDescription
boolean `true` in case the field can be read by the user.

 

canBeWrittenBy

canBeWrittenBy(fieldName, user)

Checks if a field can be written by a user.

Parameters:

NameTypeDescription
fieldName string name of the field.
user User to check access for.

Returns:

TypeDescription
boolean `true` in case the field can be written by the user.

 

findFieldByName

findFieldByName(name)

Returns the project's field with the specified name.

Parameters:

NameTypeDescription
name String Field name.

Returns:

TypeDescription
ProjectCustomField Field with the specified name.

 

intervalToWorkingMinutes

intervalToWorkingMinutes(start, end)

Get number of minutes for interval.F.i. if interval is two days long and number of working hours a day is set to 8, then result will be 2 * 8 * 60 = 960

Parameters:

NameTypeDescription
start Number start of period
end Number end of period

Returns:

TypeDescription
Number number of working minutes, containing in this interval

 

isChanged

isChanged(fieldName)

Checks if a field is changed in the current transaction.

Parameters:

NameTypeDescription
fieldName string name of the field (e.g. 'summary') to check.

Returns:

TypeDescription
boolean `true` in case the field is changed in the current transaction.

 

oldValue

oldValue(fieldName)

Returns the previous value of a single-valued field before an update was applied. In case the field is not changedin the transaction, this value is equal to the current value of the field.

Parameters:

NameTypeDescription
fieldName string name of the field (e.g. 'updated') to get previous value of.

Returns:

TypeDescription
Object previous value of the field.

 

required

required(fieldName, message)

Checks if a the entity has a field denoted by field name set, shows error message otherwise.

Parameters:

NameTypeDescription
fieldName string name of the field to check.
message string message to show in case the field is not set.

 

Last modified: 9 August 2017