getDefaultValues method
Returns a paginated list of defaults for a custom field.
The results can be filtered by contextId
, otherwise all values are
returned. If no defaults are set for a context, nothing is returned.
The returned object depends on type of the custom field:
CustomFieldContextDefaultValueDate
(typedatepicker
) for date fields.CustomFieldContextDefaultValueDateTime
(typedatetimepicker
) for date-time fields.CustomFieldContextDefaultValueSingleOption
(typeoption.single
) for single choice select lists and radio buttons.CustomFieldContextDefaultValueMultipleOption
(typeoption.multiple
) for multiple choice select lists and checkboxes.CustomFieldContextDefaultValueCascadingOption
(typeoption.cascading
) for cascading select lists.CustomFieldContextSingleUserPickerDefaults
(typesingle.user.select
) for single users.CustomFieldContextDefaultValueMultiUserPicker
(typemulti.user.select
) for user lists.CustomFieldContextDefaultValueSingleGroupPicker
(typegrouppicker.single
) for single choice group pickers.CustomFieldContextDefaultValueMultipleGroupPicker
(typegrouppicker.multiple
) for multiple choice group pickers.CustomFieldContextDefaultValueURL
(typeurl
) for URLs.CustomFieldContextDefaultValueProject
(typeproject
) for project pickers.CustomFieldContextDefaultValueFloat
(typefloat
) for floats (floating-point numbers).CustomFieldContextDefaultValueLabels
(typelabels
) for labels.CustomFieldContextDefaultValueTextField
(typetextfield
) for text fields.CustomFieldContextDefaultValueTextArea
(typetextarea
) for text area fields.CustomFieldContextDefaultValueReadOnly
(typereadonly
) for read only (text) fields.CustomFieldContextDefaultValueMultipleVersion
(typeversion.multiple
) for single choice version pickers.CustomFieldContextDefaultValueSingleVersion
(typeversion.single
) for multiple choice version pickers.
Forge custom fields types are also supported, returning:
CustomFieldContextDefaultValueForgeStringFieldBean
(typeforge.string
) for Forge string fields.CustomFieldContextDefaultValueForgeMultiStringFieldBean
(typeforge.string.list
) for Forge string collection fields.CustomFieldContextDefaultValueForgeObjectFieldBean
(typeforge.object
) for Forge object fields.CustomFieldContextDefaultValueForgeDateTimeFieldBean
(typeforge.datetime
) for Forge date-time fields.CustomFieldContextDefaultValueForgeGroupFieldBean
(typeforge.group
) for Forge group fields.CustomFieldContextDefaultValueForgeMultiGroupFieldBean
(typeforge.group.list
) for Forge group collection fields.CustomFieldContextDefaultValueForgeNumberFieldBean
(typeforge.number
) for Forge number fields.CustomFieldContextDefaultValueForgeUserFieldBean
(typeforge.user
) for Forge user fields.CustomFieldContextDefaultValueForgeMultiUserFieldBean
(typeforge.user.list
) for Forge user collection fields.
Permissions required: Administer Jira global permission.
Implementation
Future<PageBeanCustomFieldContextDefaultValue> getDefaultValues(
{required String fieldId,
List<int>? contextId,
int? startAt,
int? maxResults}) async {
return PageBeanCustomFieldContextDefaultValue.fromJson(await _client.send(
'get',
'rest/api/3/field/{fieldId}/context/defaultValue',
pathParameters: {
'fieldId': fieldId,
},
queryParameters: {
if (contextId != null)
'contextId': contextId.map((e) => '$e').join(','),
if (startAt != null) 'startAt': '$startAt',
if (maxResults != null) 'maxResults': '$maxResults',
},
));
}