public class

IssueInputParametersImpl

extends Object
implements IssueInputParameters
java.lang.Object
   ↳ com.atlassian.jira.issue.IssueInputParametersImpl

Class Overview

Default implementation of IssueInputParameters.

Plugin developers should call newIssueInputParameters() or newIssueInputParameters(java.util.Map).

Summary

Public Constructors
IssueInputParametersImpl()
IssueInputParametersImpl(Map<StringString[]> actionParameters)
Can be used to quickly convert some "web-style" parameters (which can be the result of a form submit with the fields rendered create/edit html) to an IssueInputParameters object.
Public Methods
IssueInputParameters addCustomFieldValue(String fullCustomFieldKey, String... values)
Adds a value for a custom field with the specified full key.
IssueInputParameters addCustomFieldValue(Long customFieldId, String... values)
Adds a value for a custom field with the specified id.
void addFieldToForcePresent(String fieldId)
Extra fields to consider present, even if they are not in the actionParams.
boolean applyDefaultValuesWhenParameterNotProvided()
Map<StringString[]> getActionParameters()
This provides the "web-style" parameters that JIRA fields expect to perform their functions.
Long[] getAffectedVersionIds()
String getAssigneeId()
String getCommentValue()
Long[] getComponentIds()
String[] getCustomFieldValue(String fullCustomFieldKey)
String[] getCustomFieldValue(Long customFieldId)
String getDescription()
String getDueDate()
String getEnvironment()
Map<StringObject> getFieldValuesHolder()
Long[] getFixVersionIds()
String getFormToken()
Return form token if it is present in input parameters
HistoryMetadata getHistoryMetadata()
String getIssueTypeId()
Long getOriginalEstimate()
Gets the original estimate set.
String getOriginalEstimateAsDurationString()
Gets the original estimate set.
String getPriorityId()
Long getProjectId()
Collection<String> getProvidedFields()
Long getRemainingEstimate()
Gets the remaining estimate set.
String getRemainingEstimateAsDurationString()
Gets the remaining estimate provided If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this will return the same as getOriginalEstimateAsDurationString().
String getReporterId()
String getResolutionDate()
String getResolutionId()
Long getSecurityLevelId()
String getStatusId()
String getSummary()
Long getTimeSpent()
boolean isFieldPresent(String fieldId)
boolean isFieldSet(String fieldId)
boolean onlyValidatePresentFieldsWhenRetainingExistingValues()
Get the flag to designate which fields are to be validated when the retainExistingValuesWhenParameterNotProvided() flag is set to true.
boolean retainExistingValuesWhenParameterNotProvided()
IssueInputParameters setAffectedVersionIds(Long... affectedVersionIds)
void setApplyDefaultValuesWhenParameterNotProvided(boolean applyDefaultValuesWhenParameterNotProvided)
IssueInputParameters setAssigneeId(String assigneeId)
IssueInputParameters setComment(String comment, String groupId)
Set a comment value with a group restriction.
IssueInputParameters setComment(String comment, Long projectRoleId)
Set a comment value with a project role restriction.
IssueInputParameters setComment(String comment)
Set a comment value with no visibility restrictions.
IssueInputParameters setComponentIds(Long... componentIds)
IssueInputParameters setDescription(String description)
IssueInputParameters setDueDate(String dueDate)
IssueInputParameters setEnvironment(String environment)
void setFieldValuesHolder(Map<StringObject> fieldValuesHolder)
If set the validation will use the seed values from this field values holder.
IssueInputParameters setFixVersionIds(Long... fixVersionIds)
IssueInputParameters setHistoryMetadata(HistoryMetadata historyMetadata)
Allows defining history metadata related to the issue update.
IssueInputParameters setIssueTypeId(String issueTypeId)
IssueInputParameters setOriginalAndRemainingEstimate(String originalEstimate, String remainingEstimate)
Sets both the original and remaining estimate on the issue.
IssueInputParameters setOriginalAndRemainingEstimate(Long originalEstimate, Long remainingEstimate)
Sets both the original and remaining estimate on the issue.
IssueInputParameters setOriginalEstimate(Long originalEstimate)
Sets the original estimate on the issue.
IssueInputParameters setOriginalEstimate(String originalEstimate)
Sets the original estimate on the issue.
IssueInputParameters setPriorityId(String priorityId)
IssueInputParameters setProjectId(Long projectId)
void setProvidedFields(Collection<String> providedFields)
Use this to indicate which fields validation should be performed on, if left alone then the systems configured fields for either create/update will be used.
IssueInputParameters setRemainingEstimate(Long remainingEstimate)
Sets the remaining estimate on the issue If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method behaves differently.
IssueInputParameters setRemainingEstimate(String remainingEstimate)
Sets the remaining estimate on the issue If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method behaves differently.
IssueInputParameters setReporterId(String reporterId)
IssueInputParameters setResolutionDate(String resolutionDate)
IssueInputParameters setResolutionId(String resolutionId)
void setRetainExistingValuesWhenParameterNotProvided(boolean retain)
Flag to designate whether existing values should be retained when no parameter is provided.
void setRetainExistingValuesWhenParameterNotProvided(boolean retainExistingValues, boolean onlyValidatePresentFields)
IssueInputParameters setSecurityLevelId(Long securityLevelId)
void setSkipScreenCheck(boolean skipScreenCheck)
Set the flag to skip screen checks during create or update.
IssueInputParameters setStatusId(String statusId)
IssueInputParameters setSummary(String summary)
IssueInputParameters setTimeSpent(Long timeSpent)
boolean skipScreenCheck()
Get the flag to skip screen checks during create or update.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.IssueInputParameters

Public Constructors

public IssueInputParametersImpl ()

public IssueInputParametersImpl (Map<StringString[]> actionParameters)

Can be used to quickly convert some "web-style" parameters (which can be the result of a form submit with the fields rendered create/edit html) to an IssueInputParameters object.

Parameters
actionParameters provides the default starting values for this object.

Public Methods

public IssueInputParameters addCustomFieldValue (String fullCustomFieldKey, String... values)

Adds a value for a custom field with the specified full key. This will put a value in the web-style parameters with a key as provided.

Parameters
fullCustomFieldKey used in the "web-style" parameters as the key, the custom field should expect this value as the key in its populate from parameters method.
values the custom field values, must be in the format the field expects.
Returns
  • this object.

public IssueInputParameters addCustomFieldValue (Long customFieldId, String... values)

Adds a value for a custom field with the specified id. This will put a value in the web-style parameters with a key of the form "customfield_PROVIDED_ID". If you want to specify the key then use the method #addCustomFieldValue(String, String...).

Parameters
customFieldId the unique identifier of the custom field.
values the custom field values, must be in the format the field expects.
Returns
  • this object.

public void addFieldToForcePresent (String fieldId)

Extra fields to consider present, even if they are not in the actionParams. When "setRetainExisitingValuesWhenParameterNotProvided" is true, a field is not considered for update if its parameter is not provided. You can force a field to be considered even if its parameter is not providfed by forcing it to be considered by this setter.

The action post params can also contain an array of fieldIds under the "fieldsToForcePresent" param.

This may be useful if you want to clear a field's value in a single field edit.

Parameters
fieldId the id of the field to force to be present

public boolean applyDefaultValuesWhenParameterNotProvided ()

public Map<StringString[]> getActionParameters ()

This provides the "web-style" parameters that JIRA fields expect to perform their functions.

Returns
  • this is a raw map of "web" style input parameters. These parameters are used to allow the fields to attain the user inputted values. This map is of the style: <field_name> <String [] {value}>.

public Long[] getAffectedVersionIds ()

public String getAssigneeId ()

public String getCommentValue ()

public Long[] getComponentIds ()

public String[] getCustomFieldValue (String fullCustomFieldKey)

public String[] getCustomFieldValue (Long customFieldId)

public String getDescription ()

public String getDueDate ()

public String getEnvironment ()

public Map<StringObject> getFieldValuesHolder ()

public Long[] getFixVersionIds ()

public String getFormToken ()

Return form token if it is present in input parameters

public HistoryMetadata getHistoryMetadata ()

public String getIssueTypeId ()

public Long getOriginalEstimate ()

Gets the original estimate set. If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this will return the same as getRemainingEstimate(). See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Returns
  • the set original estimate, null if one does not exist or it is not a valid number.

public String getOriginalEstimateAsDurationString ()

Gets the original estimate set. If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this will return the same as getRemainingEstimateAsDurationString(). See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Returns
  • the set original estimate, null if one does not exist.

public String getPriorityId ()

public Long getProjectId ()

public Collection<String> getProvidedFields ()

public Long getRemainingEstimate ()

Gets the remaining estimate set. If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this will return the same as getOriginalEstimate() . See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Returns
  • the set remaining estimate, null if one does not exist or it is not a valid number.

public String getRemainingEstimateAsDurationString ()

Gets the remaining estimate provided If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this will return the same as getOriginalEstimateAsDurationString(). See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Returns
  • the set remaining estimate, null if one does not exist.

public String getReporterId ()

public String getResolutionDate ()

public String getResolutionId ()

public Long getSecurityLevelId ()

public String getStatusId ()

public String getSummary ()

public Long getTimeSpent ()

public boolean isFieldPresent (String fieldId)

public boolean isFieldSet (String fieldId)

public boolean onlyValidatePresentFieldsWhenRetainingExistingValues ()

Get the flag to designate which fields are to be validated when the retainExistingValuesWhenParameterNotProvided() flag is set to true.

If this flag is true, only fields which are "present" will take part in validation (and subsequently update) on the issue. This allows single-field edits to ignore the validation of other fields on the issue.

If this flag is false, or if retainExistingValuesWhenParameterNotProvided() is false, then all fields on the screen of the current operation will partake in the "validation-update" step.

Returns
  • whether or not to only validate present fields

public boolean retainExistingValuesWhenParameterNotProvided ()

public IssueInputParameters setAffectedVersionIds (Long... affectedVersionIds)

public void setApplyDefaultValuesWhenParameterNotProvided (boolean applyDefaultValuesWhenParameterNotProvided)

public IssueInputParameters setAssigneeId (String assigneeId)

public IssueInputParameters setComment (String comment, String groupId)

Set a comment value with a group restriction.

Parameters
comment the comment value.
groupId the group name that the comment must be restricted by.
Returns
  • this object.

public IssueInputParameters setComment (String comment, Long projectRoleId)

Set a comment value with a project role restriction.

Parameters
comment the comment value.
projectRoleId the id of the project role the comment must be restricted by.
Returns
  • this object.

public IssueInputParameters setComment (String comment)

Set a comment value with no visibility restrictions.

Parameters
comment the comment value.
Returns
  • this object.

public IssueInputParameters setComponentIds (Long... componentIds)

public IssueInputParameters setDescription (String description)

public IssueInputParameters setDueDate (String dueDate)

public IssueInputParameters setEnvironment (String environment)

public void setFieldValuesHolder (Map<StringObject> fieldValuesHolder)

If set the validation will use the seed values from this field values holder.

Parameters
fieldValuesHolder provides the seed values for the field values holder.

public IssueInputParameters setFixVersionIds (Long... fixVersionIds)

public IssueInputParameters setHistoryMetadata (HistoryMetadata historyMetadata)

Allows defining history metadata related to the issue update. This is only relevant for changes that generate history entries (transitions and updates).

Parameters
historyMetadata the metadata to save with the history change
Returns
  • this object

public IssueInputParameters setIssueTypeId (String issueTypeId)

public IssueInputParameters setOriginalAndRemainingEstimate (String originalEstimate, String remainingEstimate)

Sets both the original and remaining estimate on the issue. If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method has no effect. See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Parameters
originalEstimate the new original estimate, e.g. "1d 5h" for 1 day and 5 hours
remainingEstimate the new remaining estimate, e.g. "1d 5h" for 1 day and 5 hours
Returns
  • this object

public IssueInputParameters setOriginalAndRemainingEstimate (Long originalEstimate, Long remainingEstimate)

Sets both the original and remaining estimate on the issue. If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method has no effect. See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Parameters
originalEstimate the new original estimate. The units used are determined by JIRA_TIMETRACKING_DEFAULT_UNIT.
remainingEstimate the new remaining estimate.The units used are determined by JIRA_TIMETRACKING_DEFAULT_UNIT.
Returns
  • this object

public IssueInputParameters setOriginalEstimate (Long originalEstimate)

Sets the original estimate on the issue. If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method behaves differently. See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Parameters
originalEstimate the new original estimate on the issue. The units used are determined by JIRA_TIMETRACKING_DEFAULT_UNIT.
Returns
  • this object.

public IssueInputParameters setOriginalEstimate (String originalEstimate)

Sets the original estimate on the issue. If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method behaves differently. See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Parameters
originalEstimate the new original estimate on the issue, e.g. "1d 5h" for 1 day and 5 hours
Returns
  • this object.

public IssueInputParameters setPriorityId (String priorityId)

public IssueInputParameters setProjectId (Long projectId)

public void setProvidedFields (Collection<String> providedFields)

Use this to indicate which fields validation should be performed on, if left alone then the systems configured fields for either create/update will be used.

Parameters
providedFields a collection of getId()'s which identify the fields.

public IssueInputParameters setRemainingEstimate (Long remainingEstimate)

Sets the remaining estimate on the issue If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method behaves differently. See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Parameters
remainingEstimate the remaining estimate on the issue. The units used are determined by JIRA_TIMETRACKING_DEFAULT_UNIT.
Returns
  • this object

public IssueInputParameters setRemainingEstimate (String remainingEstimate)

Sets the remaining estimate on the issue If (JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR is set, we are in legacy time tracking mode and this method behaves differently. See http://confluence.atlassian.com/display/JIRA044/Configuring+Time+Tracking#ConfiguringTimeTracking-legacymode for more information on legacy mode.

Parameters
remainingEstimate the remaining estimate on the issue, e.g. "1d 5h" for 1 day and 5 hours
Returns
  • this object

public IssueInputParameters setReporterId (String reporterId)

public IssueInputParameters setResolutionDate (String resolutionDate)

public IssueInputParameters setResolutionId (String resolutionId)

public void setRetainExistingValuesWhenParameterNotProvided (boolean retain)

Flag to designate whether existing values should be retained when no parameter is provided.

Note: setting this flag here will assume that validation of fields should still occur, even if they were not specified. To change this, please use setRetainExistingValuesWhenParameterNotProvided(boolean, boolean) instead.

Parameters
retain true if non-provided parameters should have the values retained, false otherwise.

public void setRetainExistingValuesWhenParameterNotProvided (boolean retainExistingValues, boolean onlyValidatePresentFields)

Set flags retainExistingValuesWhenParameterNotProvided() and onlyValidatePresentFieldsWhenRetainingExistingValues().

The latter is only relevant when the former is true.

Parameters
retainExistingValues true if non-provided parameters should have the values retained, false otherwise.
onlyValidatePresentFields whether or not to only validate present fields

public IssueInputParameters setSecurityLevelId (Long securityLevelId)

public void setSkipScreenCheck (boolean skipScreenCheck)

Set the flag to skip screen checks during create or update.

By default, the Issue Service only allows setting values to fields which appear on the screen of the operation which you are performing (e.g. the Edit screen). By enabling this flag, the Issue Service will skip this check.

Parameters
skipScreenCheck whether or not we are skipping screen check

public IssueInputParameters setStatusId (String statusId)

public IssueInputParameters setSummary (String summary)

public IssueInputParameters setTimeSpent (Long timeSpent)

public boolean skipScreenCheck ()

Get the flag to skip screen checks during create or update.

By default, the Issue Service only allows setting values to fields which appear on the screen of the operation which you are performing (e.g. the Edit screen). By enabling this flag, the Issue Service will skip this check.

Returns
  • whether or not we are skipping screen check