Interface IssueInputParameters
- All Known Implementing Classes:
IssueInputParametersImpl
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.
- Since:
- v4.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddCustomFieldValue
(Long customFieldId, String... values) Adds a value for a custom field with the specified id.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.addProperty
(String propertyKey, String propertyValue) Allows properties to be set on issues during create or updateboolean
This provides the "web-style" parameters that JIRA fields expect to perform their functions.Long[]
Long[]
String[]
getCustomFieldValue
(Long customFieldId) String[]
getCustomFieldValue
(String fullCustomFieldKey) Long[]
Return form token if it is present in input parametersGets the original estimate set.Gets the original estimate set.Gets the remaining estimate set.Gets the remaining estimate providedboolean
isFieldPresent
(String fieldId) boolean
isFieldSet
(String fieldId) boolean
Get the flag to designate which fields are to be validated when theretainExistingValuesWhenParameterNotProvided()
flag is set totrue
.boolean
setAffectedVersionIds
(Long... affectedVersionIds) void
setApplyDefaultValuesWhenParameterNotProvided
(boolean applyDefaults) setAssigneeId
(String assigneeId) setComment
(String comment) Set a comment value with no visibility restrictions.setComment
(String comment, Long projectRoleId) Set a comment value with a project role restriction.setComment
(String comment, String groupId) Set a comment value with a group restriction.setComponentIds
(Long... componentIds) setDescription
(String description) setDueDate
(String dueDate) setEnvironment
(String environment) void
setFieldValuesHolder
(Map<String, Object> fieldValuesHolder) If set the validation will use the seed values from this field values holder.setFixVersionIds
(Long... fixVersionIds) setHistoryMetadata
(HistoryMetadata historyMetadata) Allows defining history metadata related to the issue update.setIssueTypeId
(String issueTypeId) setOriginalAndRemainingEstimate
(Long originalEstimate, Long remainingEstimate) Sets both the original and remaining estimate on the issue.setOriginalAndRemainingEstimate
(String originalEstimate, String remainingEstimate) Sets both the original and remaining estimate on the issue.setOriginalEstimate
(Long originalEstimate) Sets the original estimate on the issue.setOriginalEstimate
(String originalEstimate) Sets the original estimate on the issue.setPriorityId
(String priorityId) 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.setRemainingEstimate
(Long remainingEstimate) Sets the remaining estimate on the issuesetRemainingEstimate
(String remainingEstimate) Sets the remaining estimate on the issuesetReporterId
(String reporterId) setResolutionDate
(String resolutionDate) 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) 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.setStatusId
(String statusId) setSummary
(String summary) setTimeSpent
(Long timeSpent) boolean
Returnstrue
if theskipLicenceCheck
flag is set.boolean
Get the flag to skip screen checks during create, update or transition.
-
Method Details
-
retainExistingValuesWhenParameterNotProvided
boolean retainExistingValuesWhenParameterNotProvided()- Returns:
- true if the issues value should be retained when a parameter has not been provided, false if the missing parameter should be treated as an update.
-
setRetainExistingValuesWhenParameterNotProvided
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.- See Also:
-
setRetainExistingValuesWhenParameterNotProvided
void setRetainExistingValuesWhenParameterNotProvided(boolean retainExistingValues, boolean onlyValidatePresentFields) Set flagsretainExistingValuesWhenParameterNotProvided()
andonlyValidatePresentFieldsWhenRetainingExistingValues()
.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- Since:
- v5.0.2
- See Also:
-
onlyValidatePresentFieldsWhenRetainingExistingValues
boolean onlyValidatePresentFieldsWhenRetainingExistingValues()Get the flag to designate which fields are to be validated when theretainExistingValuesWhenParameterNotProvided()
flag is set totrue
.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 ifretainExistingValuesWhenParameterNotProvided()
isfalse
, 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
- Since:
- v5.0.2
- See Also:
-
applyDefaultValuesWhenParameterNotProvided
boolean applyDefaultValuesWhenParameterNotProvided()- Returns:
- true if default value should be supplied when a parameter has not been provided. false if the default value should not be applied.
-
setApplyDefaultValuesWhenParameterNotProvided
void setApplyDefaultValuesWhenParameterNotProvided(boolean applyDefaults) - Parameters:
applyDefaults
- true if default value should be supplied when a parameter has not been provided. false if the default value should not be applied.
-
skipScreenCheck
boolean skipScreenCheck()Get the flag to skip screen checks during create, update or transition.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
- Since:
- v5.0 for editing, v6.3 for creating
- See Also:
-
setSkipScreenCheck
void setSkipScreenCheck(boolean skipScreenCheck) Set the flag to skip screen checks during create, update or transition.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- Since:
- v5.0 supports for editing, v6.3 for creating
- See Also:
-
skipLicenceCheck
boolean skipLicenceCheck()Returnstrue
if theskipLicenceCheck
flag is set.- Returns:
- the value of the
skipLicenceCheck
flag. - Since:
- v7.1
-
setSkipLicenceCheck
void setSkipLicenceCheck(boolean skipLicenceCheck) Set the flag to skip licence checks during create.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.
- Parameters:
skipLicenceCheck
- whether or not we are skipping the licence check- Since:
- v7.1
-
getCustomFieldValue
- Parameters:
customFieldId
- uniquely identifies the custom field value you are looking for.- Returns:
- the values for the provided custom field if they exist, null otherwise.
-
getCustomFieldValue
- Parameters:
fullCustomFieldKey
- identifies the custom field values you are looking for.- Returns:
- the values for the provided custom field if they exist, null otherwise.
-
addCustomFieldValue
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 methodaddCustomFieldValue(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.
-
addCustomFieldValue
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.
-
getCommentValue
String getCommentValue()- Returns:
- the comment string value if it has been set, null otherwise.
-
setComment
Set a comment value with no visibility restrictions.- Parameters:
comment
- the comment value.- Returns:
- this object.
-
setComment
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.
-
setComment
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.
-
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}>.
-
setFieldValuesHolder
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.
-
getFieldValuesHolder
- Returns:
- the provided field values holder or an empty map, never null.
-
getProvidedFields
Collection<String> getProvidedFields()- Returns:
- the field id's that should be validated, null if not specified.
-
setProvidedFields
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 ofField.getId()
's which identify the fields.
-
isFieldSet
- Parameters:
fieldId
- identifies the field in question, this will be theField.getId()
.- Returns:
- true if a non-null, non-empty value has been set for the field, false if not.
-
isFieldPresent
- Parameters:
fieldId
- identifies the field in question, this will be theField.getId()
.- Returns:
- true if the field has been set, even with an empty value, false if not.
-
addFieldToForcePresent
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- Since:
- 5.0.2
-
setProjectId
- Parameters:
projectId
- sets the project id for the issue.- Returns:
- this object.
-
getProjectId
Long getProjectId()- Returns:
- the set project id, null if one does not exist or if it is not a valid number.
-
setIssueTypeId
- Parameters:
issueTypeId
- sets the issue type for the issue.- Returns:
- this object.
-
getIssueTypeId
String getIssueTypeId()- Returns:
- the set issue type id, null if one does not exist.
-
setPriorityId
- Parameters:
priorityId
- sets the priority for the issue.- Returns:
- this object.
-
getPriorityId
String getPriorityId()- Returns:
- the set priority id, null if one does not exist.
-
setResolutionId
- Parameters:
resolutionId
- sets the resolution for the issue.- Returns:
- this object.
-
getResolutionId
String getResolutionId()- Returns:
- the set resolution id, null if one does not exist.
-
setStatusId
- Parameters:
statusId
- sets the status of the issue.- Returns:
- this object.
-
getStatusId
String getStatusId()- Returns:
- the set status id, null if one does not exist.
-
setSummary
- Parameters:
summary
- sets the summary for the issue.- Returns:
- this object.
-
getSummary
String getSummary()- Returns:
- the set summary, null if one does not exist.
-
setDescription
- Parameters:
description
- sets the description for the issue.- Returns:
- this object.
-
getDescription
String getDescription()- Returns:
- the set description, null if one does not exist.
-
setEnvironment
- Parameters:
environment
- sets the environment of the issue.- Returns:
- this object.
-
getEnvironment
String getEnvironment()- Returns:
- the set environment, null if one does not exist.
-
setAssigneeId
- Parameters:
assigneeId
- sets the assignee id for the issue.- Returns:
- this object.
-
getAssigneeId
String getAssigneeId()- Returns:
- the set assginee, null if one does not exist.
-
setReporterId
- Parameters:
reporterId
- sets the reporter id for the issue.- Returns:
- this object.
-
getReporterId
String getReporterId()- Returns:
- the set reporter, null if one does not exist.
-
setComponentIds
- Parameters:
componentIds
- sets the components id's on the issue.- Returns:
- this object.
-
getComponentIds
Long[] getComponentIds()- Returns:
- the set component id's, null if they do not exist or if they are not valid numbers.
-
setFixVersionIds
- Parameters:
fixVersionIds
- sets the fix version id's on the issue.- Returns:
- this object.
-
getFixVersionIds
Long[] getFixVersionIds()- Returns:
- the set fix version id's, null if they do not exist or if they are not valid numbers.
-
setAffectedVersionIds
- Parameters:
affectedVersionIds
- sets the affected version id's= on the issue.- Returns:
- this object.
-
getAffectedVersionIds
Long[] getAffectedVersionIds()- Returns:
- the set affected version id's, null if they do not exist or if they are not valid numbers.
-
setDueDate
- Parameters:
dueDate
- the formatted string that JIRA will accept as a date that will be set on the issue.- Returns:
- this object.
-
getDueDate
String getDueDate()- Returns:
- the set due date, null if one does not exist.
-
setResolutionDate
- Parameters:
resolutionDate
- the formatted string that JIRA will accept as a date that will be set on the issue.- Returns:
- this object.
-
getResolutionDate
String getResolutionDate()- Returns:
- the set resolution date, null if one does not exist.
-
setSecurityLevelId
- Parameters:
securityLevelId
- sets the security level id on the issue.- Returns:
- this object.
-
getSecurityLevelId
Long getSecurityLevelId()- Returns:
- the set security level id, null if one does not exist or it is not a valid number.
-
setOriginalEstimate
Sets the original estimate on the issue.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.
- In legacy mode, this will change 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
- In modern mode, this will only change the original estimate. If you want to change both in a single request
use
setOriginalAndRemainingEstimate(String, String)
/setOriginalAndRemainingEstimate(Long, Long)
.Calls to
setOriginalEstimate(Long)
/setOriginalEstimate(String)
andsetRemainingEstimate(Long)
/setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will not produce the desired effect.
- Parameters:
originalEstimate
- the new original estimate on the issue. The units used are determined byAPKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.- Returns:
- this object.
-
setOriginalEstimate
Sets the original estimate on the issue.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.
- In legacy mode, this will change 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
- In modern mode, this will only change the original estimate. If you want to change both in a single request
use
setOriginalAndRemainingEstimate(String, String)
. Calls tosetOriginalEstimate(Long)
/setOriginalEstimate(String)
andsetRemainingEstimate(Long)
/setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will not produce the desired effect.
- Parameters:
originalEstimate
- the new original estimate on the issue, e.g. "1d 5h" for 1 day and 5 hours- Returns:
- this object.
-
setRemainingEstimate
Sets the remaining estimate on the issueIf (
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.
- In legacy mode, this has the same behaviour as
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. - In modern mode, this will only change the remaining estimate. If you want to change both in a single request
use
setOriginalAndRemainingEstimate(String, String)
/setOriginalAndRemainingEstimate(Long, Long)
.Calls to
setOriginalEstimate(Long)
/setOriginalEstimate(String)
andsetRemainingEstimate(Long)
/setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will not produce the desired effect.
- Parameters:
remainingEstimate
- the remaining estimate on the issue, e.g. "1d 5h" for 1 day and 5 hours- Returns:
- this object
- In legacy mode, this has the same behaviour as
-
setRemainingEstimate
Sets the remaining estimate on the issueIf (
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.
- In legacy mode, this has the same behaviour as
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. - In modern mode, this will only change the remaining estimate. If you want to change both in a single request
use
setOriginalAndRemainingEstimate(String, String)
/setOriginalAndRemainingEstimate(Long, Long)
.Calls to
setOriginalEstimate(Long)
/setOriginalEstimate(String)
andsetRemainingEstimate(Long)
/setRemainingEstimate(String)
are mutually exclusive, so calling both on the same instance will not produce the desired effect.
- Parameters:
remainingEstimate
- the remaining estimate on the issue. The units used are determined byAPKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.- Returns:
- this object
- In legacy mode, this has the same behaviour as
-
setOriginalAndRemainingEstimate
IssueInputParameters setOriginalAndRemainingEstimate(String originalEstimate, String remainingEstimate) Sets both the original and remaining estimate on the issue.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.
- Parameters:
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 hours- Returns:
- this object
-
setOriginalAndRemainingEstimate
Sets both the original and remaining estimate on the issue.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.
- Parameters:
originalEstimate
- the new original estimate. The units used are determined byAPKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.remainingEstimate
- the new remaining estimate.The units used are determined byAPKeys.JIRA_TIMETRACKING_DEFAULT_UNIT
.- Returns:
- this object
-
getOriginalEstimate
Long getOriginalEstimate()Gets the original estimate set.If (
APKeys.JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR
is set, we are in legacy time tracking mode and this will return the same asgetRemainingEstimate()
.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.
-
getRemainingEstimate
Long getRemainingEstimate()Gets the remaining estimate set.If (
APKeys.JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR
is set, we are in legacy time tracking mode and this will return the same asgetOriginalEstimate()
.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.
-
getOriginalEstimateAsDurationString
String getOriginalEstimateAsDurationString()Gets the original estimate set.If (
APKeys.JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR
is set, we are in legacy time tracking mode and this will return the same asgetRemainingEstimateAsDurationString()
.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.
-
getRemainingEstimateAsDurationString
String getRemainingEstimateAsDurationString()Gets the remaining estimate providedIf (
APKeys.JIRA_OPTION_TIMETRACKING_ESTIMATES_LEGACY_BEHAVIOUR
is set, we are in legacy time tracking mode and this will return the same asgetOriginalEstimateAsDurationString()
.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.
-
setTimeSpent
- Parameters:
timeSpent
- sets the time spent on the issue.- Returns:
- this object.
-
getTimeSpent
Long getTimeSpent()- Returns:
- the set time spent, null if one does not exist or it is not a valid number.
-
setHistoryMetadata
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
- Since:
- JIRA 6.3
-
getHistoryMetadata
- Returns:
- the current history metadata for the update, null if not defined
- Since:
- JIRA 6.3
-
getFormToken
String getFormToken()Return form token if it is present in input parameters- Returns:
- the form token
-
addProperty
Allows properties to be set on issues during create or update- Parameters:
propertyKey
- the key to the propertypropertyValue
- the JSON property value- Returns:
- this object
- Since:
- 7.1.0
-
properties
- Returns:
- JSON issue properties
- Since:
- 7.1.0
-