Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Changing the name of a custom field drop-down list item

Павел Кривко July 19, 2021

I used a translator
In some cases, I need to rename an element of the drop-down list of custom fields. I didn't find a specific API method for my goal. There is an idea to first delete an element, and then add a new one, but I don't want to make unnecessary movements. Maybe there is still an API method that allows you to rename a drop-down list item?

3 answers

1 vote
milynnus
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.
July 19, 2021

I wrote this to change the option list via code. I have not tried remaining but I am able to change the colour so it might be able to ‘rename’.
 @David Bakkers change of colour can be done with code. 
https://trello.com/c/iw8Hc4cF

David Bakkers
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.
July 19, 2021

Thanks @milynnus 

I just tested it and you're right, you can set the option's color via the REST API when you create that option:

"value": {
"text": "Green option"
},
"color": "green"

I've removed that from my answer.

0 votes
Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2021

@Павел Кривко you can't rename custom field list items, what is it you're trying to achieve though? There might be another way to do it.

0 votes
David Bakkers
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.
July 19, 2021

Hello @Павел Кривко 

Sorry, but the Trello REST API currently only allows the options of a custom field to be looked up, deleted or added, but not renamed. Renaming the options or changing their order can only be done via the web GUI.

If you do want to use the REST API to rename a single option in a dropdown list, you have to essentially tear down the existing options and then rebuild them, like this:

  1. Using the REST API, GET all the options from the dropdown list as an array
  2. In your code, remove the option element from the array and replace it with the new option element.
  3. Using the REST API, sequentially DELETE all the existing options from the dropdown list.
  4. Using the REST API, sequentially POST all the new options to the dropdown list from your array.
milynnus
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.
July 19, 2021

@David Bakkers 

Agree. I checked my code, adding colour via code is when you add a new option. 

@Павел Кривко please note.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events