Hello everyone,
I have a select list field, in which I enter a value via API. I would like to know if it is possible at a later time, to set it as the default value again via API.
Thanks
Hi @FrancoB
Yes, it’s possible to update the value of a select list field via the API, but there are a couple of things to clarify:
If you mean updating the field value in an issue:
You can use the Jira REST API to set the field value to whatever you’d like, including resetting it to the "default" value you want. Here's an example of the JSON payload you’d use with the API:
{ "fields": { "customfield_<ID>": { "value": "Your Default Value" } } }
Replace customfield_<ID>
with your field’s actual custom field ID and "Your Default Value"
with the value you'd like to set.
If you mean setting the default value for the field itself (for all future issues):
Unfortunately, Jira's REST API doesn’t allow you to configure default values for fields. That has to be done manually through the custom field settings in the Jira UI:
If you’re doing this regularly via API and need the default value applied automatically, a workaround might be to use automation rules in Jira. For example, you can create a rule to set the field value to your default whenever an issue is created.
Kind Regards
Utkarsh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.