Jira provides the following endpoint https://Youdomain.atlassian.net/rest/api/3/field/customfield_10051/context/defaultValue to modify the default value of the custom field with the following request:
When creating a custom field using Forge of type string I tried to modify the default value of the field through the same request attached previously, but the server replied that there was an error in the custom field type I tried to change the value of the parameter “Type”:
HTTP/2 400 Bad Request
Server: AtlassianProxy/1.19.3.1
Cache-Control: no-cache, no-store, no-transform
Content-Type: application/json;charset=UTF-8
....
{"errorMessages":["Could not resolve type id 'String' into a subtype of [simple type, class com.atlassian.jira.bc.customfield.defaultvalue.CustomFieldContextDefaultValueBean]\n at [Source: org.apache.catalina.connector.CoyoteInputStream@12096bbc; line: 5, column: 19] (through reference chain: com.atlassian.jira.bc.customfield.defaultvalue.update.CustomFieldContextDefaultValueUpdateRequestBean[\"defaultValues\"])"]}
So please, could you tell me the type of Forge custom field that I should use so that I can modify the default value of the field through the previous request.
I’m afraid right now setting default values of Forge custom fields can be done only by Jira admins in the UI. We will look into prioritizing the work to make it possible using the REST API.
Thank you very much. Can you create a Trello card or Jira issue for the development team to add the ability to modify string fields through the REST API
Thank you for your reply. Great news, Can the new types also be used to create custom fields, or does the update only include updating the fields?
POST /rest/api/2/field HTTP/2
<....>
{
"searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:forgestring",
"name": "New custom field",
"description": "Custom field for picking groups",
"type": "forge.string"
}
Since Forge custom fields types are not built-in types, API for creating custom fields requires specific ID of Forge custom field type. That’s why it has to be an ID in format: ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key
Custom field default values can be set with the following REST API (available also for Forge apps): Set custom field contexts default values. I’m not familiar with the “Reactions” field, and if Jira even supports setting its default values like for other fields (which would be a prerequisite for the API to work). If it turns out it’s not supported by that API, feel free to create a feature request via Atlassian Support.
thank you for your reply. I actually tried using the forge.string custom field types but unfortunately I was getting an error message telling me that the type does not match. So I created a ticket to provide this feature