@PublicApi
public interface IssueInputParameters
IssueService
.
Any fields that are set on this object will have the values used for validation and population of the issue object created via the validate methods on the IssueService. This object is forgiving as possible so if you try to set a null value for a field no exceptions will be thrown, the value will just be ignored.
Some users might want to provide a FieldValuesHolder to the validation calls with some pre-populated data, if this is the case then you can set the field values holder on this object and the IssueService will clone the contents and pass them along to any field invocations it might make.
If you wish to indicate to the IssueService that you do not want to validate against all fields configured for
the create screen then you can set the setProvidedFields(java.util.Collection)
with the field
id's that you want to have validated. All other fields that exist on the screen will be populated with the system
default.
To construct a new IssueInputParameters object you can call IssueService.newIssueInputParameters()
.
NOTE: this object is not thread-safe and is only meant to be used as a transport object.
IssueService.newIssueInputParameters()
,
IssueService.newIssueInputParameters(java.util.Map)
Modifier and Type | Method and Description |
---|---|
IssueInputParameters |
addCustomFieldValue(Long customFieldId,
String... values)
Adds a value for a custom field with the specified id.
|
IssueInputParameters |
addCustomFieldValue(String fullCustomFieldKey,
String... values)
Adds a value for a custom field with the specified full key.
|
void |
addFieldToForcePresent(String fieldId)
Extra fields to consider present, even if they are not in the actionParams.
|
IssueInputParameters |
addProperty(String propertyKey,
org.codehaus.jackson.JsonNode propertyValue)
Allows properties to be set on issues during create or update
|
boolean |
applyDefaultValuesWhenParameterNotProvided() |
Map<String,String[]> |
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(Long customFieldId) |
String[] |
getCustomFieldValue(String fullCustomFieldKey) |
String |
getDescription() |
String |
getDueDate() |
String |
getEnvironment() |
Map<String,Object> |
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
|
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 . |
Map<String,org.codehaus.jackson.JsonNode> |
properties() |
boolean |
retainExistingValuesWhenParameterNotProvided() |
IssueInputParameters |
setAffectedVersionIds(Long... affectedVersionIds) |
void |
setApplyDefaultValuesWhenParameterNotProvided(boolean applyDefaults) |
IssueInputParameters |
setAssigneeId(String assigneeId) |
IssueInputParameters |
setComment(String comment)
Set a comment value with no visibility restrictions.
|
IssueInputParameters |
setComment(String comment,
Long projectRoleId)
Set a comment value with a project role restriction.
|
IssueInputParameters |
setComment(String comment,
String groupId)
Set a comment value with a group restriction.
|
IssueInputParameters |
setComponentIds(Long... componentIds) |
IssueInputParameters |
setDescription(String description) |
IssueInputParameters |
setDueDate(String dueDate) |
IssueInputParameters |
setEnvironment(String environment) |
void |
setFieldValuesHolder(Map<String,Object> 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(Long originalEstimate,
Long remainingEstimate)
Sets both the original and remaining estimate on the issue.
|
IssueInputParameters |
setOriginalAndRemainingEstimate(String originalEstimate,
String 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
|
IssueInputParameters |
setRemainingEstimate(String remainingEstimate)
Sets the remaining estimate on the issue
|
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 |
setSkipLicenceCheck(boolean skipLicenceCheck)
Set the flag to skip licence checks during create.
|
void |
setSkipScreenCheck(boolean skipScreenCheck)
Set the flag to skip screen checks during create, update or transition.
|
IssueInputParameters |
setStatusId(String statusId) |
IssueInputParameters |
setSummary(String summary) |
IssueInputParameters |
setTimeSpent(Long timeSpent) |
boolean |
skipLicenceCheck()
Returns
true if the skipLicenceCheck flag is set. |
boolean |
skipScreenCheck()
Get the flag to skip screen checks during create, update or transition.
|
boolean retainExistingValuesWhenParameterNotProvided()
void setRetainExistingValuesWhenParameterNotProvided(boolean retain)
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.
retain
- true if non-provided parameters should have the values retained, false otherwise.retainExistingValuesWhenParameterNotProvided()
,
setRetainExistingValuesWhenParameterNotProvided(boolean, boolean)
void setRetainExistingValuesWhenParameterNotProvided(boolean retainExistingValues, boolean onlyValidatePresentFields)
retainExistingValuesWhenParameterNotProvided()
and onlyValidatePresentFieldsWhenRetainingExistingValues()
.
The latter is only relevant when the former is true.
retainExistingValues
- true if non-provided parameters should have the values retained, false otherwise.onlyValidatePresentFields
- whether or not to only validate present fieldsonlyValidatePresentFieldsWhenRetainingExistingValues()
,
IssueService.validateUpdate(ApplicationUser, Long, IssueInputParameters)
boolean onlyValidatePresentFieldsWhenRetainingExistingValues()
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.
IssueService.validateUpdate(ApplicationUser, Long, IssueInputParameters)
boolean applyDefaultValuesWhenParameterNotProvided()
void setApplyDefaultValuesWhenParameterNotProvided(boolean applyDefaults)
applyDefaults
- true if default value should be supplied when a parameter has not been provided. false if the
default value should not be applied.boolean skipScreenCheck()
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.
IssueService.validateUpdate(ApplicationUser, Long, IssueInputParameters)
,
IssueService.validateCreate(ApplicationUser, IssueInputParameters)
void setSkipScreenCheck(boolean skipScreenCheck)
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.
skipScreenCheck
- whether or not we are skipping screen checkIssueService.validateUpdate(ApplicationUser, Long, IssueInputParameters)
,
IssueService.validateCreate(ApplicationUser, IssueInputParameters)
boolean skipLicenceCheck()
true
if the skipLicenceCheck
flag is set.skipLicenceCheck
flag.void setSkipLicenceCheck(boolean skipLicenceCheck)
By default, the Issue Service will check the user is licensed to an application role. By enabling this flag, the Issue Service will skip this check.
skipLicenceCheck
- whether or not we are skipping the licence checkString[] getCustomFieldValue(Long customFieldId)
customFieldId
- uniquely identifies the custom field value you are looking for.String[] getCustomFieldValue(String fullCustomFieldKey)
fullCustomFieldKey
- identifies the custom field values you are looking for.IssueInputParameters addCustomFieldValue(Long customFieldId, String... values)
addCustomFieldValue(String, String...)
.customFieldId
- the unique identifier of the custom field.values
- the custom field values, must be in the format the field expects.IssueInputParameters addCustomFieldValue(String fullCustomFieldKey, String... values)
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.String getCommentValue()
IssueInputParameters setComment(String comment)
comment
- the comment value.IssueInputParameters setComment(String comment, Long projectRoleId)
comment
- the comment value.projectRoleId
- the id of the project role the comment must be restricted by.IssueInputParameters setComment(String comment, String groupId)
comment
- the comment value.groupId
- the group name that the comment must be restricted by.Map<String,String[]> getActionParameters()
void setFieldValuesHolder(Map<String,Object> fieldValuesHolder)
fieldValuesHolder
- provides the seed values for the field values holder.Map<String,Object> getFieldValuesHolder()
Collection<String> getProvidedFields()
void setProvidedFields(Collection<String> providedFields)
providedFields
- a collection of Field.getId()
's which identify the
fields.boolean isFieldSet(String fieldId)
fieldId
- identifies the field in question, this will be the Field.getId()
.boolean isFieldPresent(String fieldId)
fieldId
- identifies the field in question, this will be the Field.getId()
.void addFieldToForcePresent(String fieldId)
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.
fieldId
- the id of the field to force to be presentIssueInputParameters setProjectId(Long projectId)
projectId
- sets the project id for the issue.Long getProjectId()
IssueInputParameters setIssueTypeId(String issueTypeId)
issueTypeId
- sets the issue type for the issue.String getIssueTypeId()
IssueInputParameters setPriorityId(String priorityId)
priorityId
- sets the priority for the issue.String getPriorityId()
IssueInputParameters setResolutionId(String resolutionId)
resolutionId
- sets the resolution for the issue.String getResolutionId()
IssueInputParameters setStatusId(String statusId)
statusId
- sets the status of the issue.String getStatusId()
IssueInputParameters setSummary(String summary)
summary
- sets the summary for the issue.String getSummary()
IssueInputParameters setDescription(String description)
description
- sets the description for the issue.String getDescription()
IssueInputParameters setEnvironment(String environment)
environment
- sets the environment of the issue.String getEnvironment()
IssueInputParameters setAssigneeId(String assigneeId)
assigneeId
- sets the assignee id for the issue.String getAssigneeId()
IssueInputParameters setReporterId(String reporterId)
reporterId
- sets the reporter id for the issue.String getReporterId()
IssueInputParameters setComponentIds(Long... componentIds)
componentIds
- sets the components id's on the issue.Long[] getComponentIds()
IssueInputParameters setFixVersionIds(Long... fixVersionIds)
fixVersionIds
- sets the fix version id's on the issue.Long[] getFixVersionIds()
IssueInputParameters setAffectedVersionIds(Long... affectedVersionIds)
affectedVersionIds
- sets the affected version id's= on the issue.Long[] getAffectedVersionIds()
IssueInputParameters setDueDate(String dueDate)
dueDate
- the formatted string that JIRA will accept as a date that will be set on the issue.String getDueDate()
IssueInputParameters setResolutionDate(String resolutionDate)
resolutionDate
- the formatted string that JIRA will accept as a date that will be set on the issue.String getResolutionDate()
IssueInputParameters setSecurityLevelId(Long securityLevelId)
securityLevelId
- sets the security level id on the issue.Long getSecurityLevelId()
IssueInputParameters setOriginalEstimate(Long originalEstimate)
If (APKeys.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.
setOriginalAndRemainingEstimate(String, String)
/ setOriginalAndRemainingEstimate(Long, Long)
.
Calls to setOriginalEstimate(Long)
/ setOriginalEstimate(String)
and setRemainingEstimate(Long)
/
setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will
not produce the desired effect.
originalEstimate
- the new original estimate on the issue. The units used are determined by
APKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.IssueInputParameters setOriginalEstimate(String originalEstimate)
If (APKeys.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.
setOriginalAndRemainingEstimate(String, String)
. Calls to setOriginalEstimate(Long)
/
setOriginalEstimate(String)
and setRemainingEstimate(Long)
/ setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will not produce the desired effect.originalEstimate
- the new original estimate on the issue, e.g. "1d 5h" for 1 day and 5 hoursIssueInputParameters setRemainingEstimate(String remainingEstimate)
If (APKeys.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.
setOriginalEstimate(String)
, changing
the original and remaining estimate if work has not yet started.
If work has already been logged, it will alter the remaining estimate but leave the original
estimate unchanged.setOriginalAndRemainingEstimate(String, String)
/ setOriginalAndRemainingEstimate(Long, Long)
.
Calls to setOriginalEstimate(Long)
/ setOriginalEstimate(String)
and setRemainingEstimate(Long)
/
setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will
not produce the desired effect.
remainingEstimate
- the remaining estimate on the issue, e.g. "1d 5h" for 1 day and 5 hoursIssueInputParameters setRemainingEstimate(Long remainingEstimate)
If (APKeys.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.
setOriginalEstimate(String)
, changing
the original and remaining estimate if work has not yet started.
If work has already been logged, it will alter the remaining estimate but leave the original
estimate unchanged.setOriginalAndRemainingEstimate(String, String)
/ setOriginalAndRemainingEstimate(Long, Long)
.
Calls to setOriginalEstimate(Long)
/ setOriginalEstimate(String)
and setRemainingEstimate(Long)
/
setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will
not produce the desired effect.
remainingEstimate
- the remaining estimate on the issue. The units used are determined by
APKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.IssueInputParameters setOriginalAndRemainingEstimate(String originalEstimate, String remainingEstimate)
If (APKeys.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.
originalEstimate
- the new original estimate, e.g. "1d 5h" for 1 day and 5 hoursremainingEstimate
- the new remaining estimate, e.g. "1d 5h" for 1 day and 5 hoursIssueInputParameters setOriginalAndRemainingEstimate(Long originalEstimate, Long remainingEstimate)
If (APKeys.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.
originalEstimate
- the new original estimate. The units used are determined by
APKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.remainingEstimate
- the new remaining estimate.The units used are determined by
APKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.Long getOriginalEstimate()
If (APKeys.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.
Long getRemainingEstimate()
If (APKeys.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.
String getOriginalEstimateAsDurationString()
If (APKeys.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.
String getRemainingEstimateAsDurationString()
If (APKeys.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.
IssueInputParameters setTimeSpent(Long timeSpent)
timeSpent
- sets the time spent on the issue.Long getTimeSpent()
IssueInputParameters setHistoryMetadata(HistoryMetadata historyMetadata)
historyMetadata
- the metadata to save with the history change@Nullable HistoryMetadata getHistoryMetadata()
String getFormToken()
IssueInputParameters addProperty(String propertyKey, org.codehaus.jackson.JsonNode propertyValue)
propertyKey
- the key to the propertypropertyValue
- the JSON property valueCopyright © 2002-2017 Atlassian. All Rights Reserved.