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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

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.

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.

@David Bakkers 

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

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

0 votes
Iain Dooley Community Leader Jul 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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Trello

🏊‍♀️ Atlympic Event: Trello

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

108 views 1 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you