Select List field - Set Default value

FrancoB December 1, 2024

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

1 answer

0 votes
Utkarsh Agarwal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 1, 2024

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:

  1. 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.

  2. 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:

    • Go to Settings > Issues > Custom Fields, locate your field, and set the default value in its configuration.

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

FrancoB December 2, 2024

what I wanted to do was (by a scheduled autuomation) automatically change each month the default value of that list

Suggest an answer

Log in or Sign up to answer