java.lang.Object
   ↳ com.atlassian.jira.issue.fields.AbstractField
     ↳ com.atlassian.jira.issue.fields.AbstractOrderableField<V>
       ↳ com.atlassian.jira.issue.fields.WorklogSystemField

Class Overview

A field representation of logging work.

This allows JIRA administrators to place the "Log Work" field on screens. This means that JIRA users can now log work whilst creating, editing or transitioning issues. The field works in a similar way to the CommentSystemField in that while it implements the "getEditHtml" method, previously entered work logs cannot be edited. In effect, the only functionality available is to "add" more work logs.

The WorklogService is used to do the hard work of validating and creating the work logs from user input.

See Also

Summary

Nested Classes
interface WorklogSystemField.WorklogValue A value object used to aggregate all the transient values required in taking input from the UI, validating it and creating the resultant work logs. 
Constants
String PARAM_ISCREATEISSUE
String PARAM_ISDELETELOG
String PARAM_ISEDITLOG
String WORKLOG_ACTIVATE
String WORKLOG_ADJUSTESTIMATE
String WORKLOG_ADJUSTMENTAMOUNT
String WORKLOG_DESCRIPTION
String WORKLOG_ID
String WORKLOG_NEWESTIMATE
String WORKLOG_STARTDATE
String WORKLOG_TIMELOGGED
String WORKLOG_VISIBILITY_LEVEL
[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.fields.OrderableField
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.fields.AbstractField
Public Constructors
WorklogSystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, ComponentLocator componentLocator, GroupManager groupManager, DateTimeFormatterFactory dateTimeFormatterFactory, JiraBaseUrls jiraBaseUrls, EmailFormatter emailFormatter)
Public Methods
String availableForBulkEdit(BulkEditBean bulkEditBean)
boolean canRemoveValueFromIssueObject(Issue issue)
void createValue(Issue issue, WorklogSystemField.WorklogValue value)
String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)
WorklogSystemField.WorklogValue getDefaultValue(Issue issue)
String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)
FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field.
JsonData getJsonDefaultValue(IssueContext issueCtx)
Return The default data for this system field.
FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem)
Return a FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.
JsonType getJsonSchema()
Return a description of the shape of this field when represented as JSON.
RestFieldOperationsHandler getRestFieldOperation()
String getValueFromIssue(Issue issue)
Gets the value stored for this field on the provided issue.
WorklogSystemField.WorklogValue getValueFromParams(Map params)
String getViewHtml(FieldLayoutItem fieldLayoutItem, Action action, Issue issue, Map displayParameters)
String getViewHtml(FieldLayoutItem fieldLayoutItem, Action action, Issue issue, WorklogSystemField.WorklogValue value, Map displayParameters)
boolean hasValue(Issue issue)
boolean isRenderable()
Defines if a field determines itself as renderable.
boolean isShown(Issue issue)
MessagedResult needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)
void populateDefaults(Map<StringObject> fieldValuesHolder, Issue issue)
void populateForMove(Map<StringObject> fieldValuesHolder, Issue originalIssue, Issue targetIssue)
void populateFromIssue(Map<StringObject> fieldValuesHolder, Issue issue)
void populateParamsFromString(Map<StringObject> fieldValuesHolder, String stringValue, Issue issue)
void removeValueFromIssueObject(MutableIssue issue)
void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)
Sets the value as a modified external field in the issue so that this field will be updated along with all the other modified issue values.
void updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)
void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
Protected Methods
Object getRelevantParams(Map<StringString[]> inputParameters)
Defines the object that will be passed through to the create method
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.fields.AbstractOrderableField
From class com.atlassian.jira.issue.fields.AbstractField
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.Field
From interface com.atlassian.jira.issue.fields.OrderableField
From interface com.atlassian.jira.issue.fields.SearchableField
From interface com.atlassian.jira.issue.fields.renderer.RenderableField
From interface com.atlassian.jira.issue.fields.rest.RestAwareField
From interface com.atlassian.jira.issue.fields.rest.RestFieldOperations
From interface java.lang.Comparable

Constants

public static final String PARAM_ISCREATEISSUE

Constant Value: "isCreateIssue"

public static final String PARAM_ISDELETELOG

Constant Value: "isDeleteLog"

public static final String PARAM_ISEDITLOG

Constant Value: "isEditLog"

public static final String WORKLOG_ACTIVATE

Constant Value: "worklog_activate"

public static final String WORKLOG_ADJUSTESTIMATE

Constant Value: "worklog_adjustEstimate"

public static final String WORKLOG_ADJUSTMENTAMOUNT

Constant Value: "worklog_adjustmentAmount"

public static final String WORKLOG_DESCRIPTION

Constant Value: "worklog_description"

public static final String WORKLOG_ID

Constant Value: "worklog_id"

public static final String WORKLOG_NEWESTIMATE

Constant Value: "worklog_newEstimate"

public static final String WORKLOG_STARTDATE

Constant Value: "worklog_startDate"

public static final String WORKLOG_TIMELOGGED

Constant Value: "worklog_timeLogged"

public static final String WORKLOG_VISIBILITY_LEVEL

Constant Value: "worklog_visibilityLevel"

Public Constructors

public WorklogSystemField (VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, ComponentLocator componentLocator, GroupManager groupManager, DateTimeFormatterFactory dateTimeFormatterFactory, JiraBaseUrls jiraBaseUrls, EmailFormatter emailFormatter)

Public Methods

public String availableForBulkEdit (BulkEditBean bulkEditBean)

public boolean canRemoveValueFromIssueObject (Issue issue)

public void createValue (Issue issue, WorklogSystemField.WorklogValue value)

public String getCreateHtml (FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)

public WorklogSystemField.WorklogValue getDefaultValue (Issue issue)

public String getEditHtml (FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)

public FieldTypeInfo getFieldTypeInfo (FieldTypeInfoContext fieldTypeInfoContext)

Returns lower level Information about the field. This information contains allowed values and/or the autocomplete url

Parameters
fieldTypeInfoContext the FieldTypeInfoContext contains context information that is relevant to generate the FieldTypeInfo

public JsonData getJsonDefaultValue (IssueContext issueCtx)

Return The default data for this system field. May be null if there is no default.

Parameters
issueCtx Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.

public FieldJsonRepresentation getJsonFromIssue (Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem)

Return a FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.

Parameters
issue to get field data from
renderedVersionRequested whether the use requested the return of rendered/pretty data as well as raw data
fieldLayoutItem field layout for this field. Will only be supplied if the field is also an ordereable field.
Returns
  • FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.

public JsonType getJsonSchema ()

Return a description of the shape of this field when represented as JSON.

public RestFieldOperationsHandler getRestFieldOperation ()

public String getValueFromIssue (Issue issue)

Gets the value stored for this field on the provided issue.

Parameters
issue identifies the issue that will contain the value for this field.
Returns
  • the value stored on this issue for this field, null if not applicable.

public WorklogSystemField.WorklogValue getValueFromParams (Map params)

public String getViewHtml (FieldLayoutItem fieldLayoutItem, Action action, Issue issue, Map displayParameters)

public String getViewHtml (FieldLayoutItem fieldLayoutItem, Action action, Issue issue, WorklogSystemField.WorklogValue value, Map displayParameters)

public boolean hasValue (Issue issue)

public boolean isRenderable ()

Defines if a field determines itself as renderable. This is needed because of the way that customfields are implemented. Since all the real work is done in CustomFieldTypes, if we want to treat system fields and custom fields the same way in the renderers then all custom fields must implement this interface. We therefore provide this method so that the CustomFieldImpl can delegate to the CustomFieldTypes to determine if a given custom field is renderable.

Returns
  • true if the field is renderable, false otherwise.

public boolean isShown (Issue issue)

public MessagedResult needsMove (Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)

public void populateDefaults (Map<StringObject> fieldValuesHolder, Issue issue)

public void populateForMove (Map<StringObject> fieldValuesHolder, Issue originalIssue, Issue targetIssue)

public void populateFromIssue (Map<StringObject> fieldValuesHolder, Issue issue)

public void populateParamsFromString (Map<StringObject> fieldValuesHolder, String stringValue, Issue issue)

public void removeValueFromIssueObject (MutableIssue issue)

public void updateIssue (FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)

Sets the value as a modified external field in the issue so that this field will be updated along with all the other modified issue values.

public void updateValue (FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)

public void validateParams (OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)

Protected Methods

protected Object getRelevantParams (Map<StringString[]> inputParameters)

Defines the object that will be passed through to the create method

Parameters
inputParameters is a representation of the request params that are available
Returns