setDefaultValues method
Future
setDefaultValues({
- required String fieldId,
- required CustomFieldContextDefaultValueUpdate body,
Sets default for contexts of a custom field. Default are defined using these objects:
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.
Only one type of default object can be included in a request. To remove a
default for a context, set the default parameter to null
.
Permissions required: Administer Jira global permission.
Implementation
Future<dynamic> setDefaultValues(
{required String fieldId,
required CustomFieldContextDefaultValueUpdate body}) async {
return await _client.send(
'put',
'rest/api/3/field/{fieldId}/context/defaultValue',
pathParameters: {
'fieldId': fieldId,
},
body: body.toJson(),
);
}