Hello :)
First time posting, thank you for any help & guidance.
I'm attempting to store custom field values using GET /1/cards/{id}/customFieldItems
My problem is that the order of the custom fields response is inconsistent, meaning my bracket notation to access the value is unreliable as the fields do not appear in the same position.
value = response[0]['value']['number'];
Please see screenshot which shows the response of 4 separate cards in a list.
Can someone please provide some knowledge as to why this happens and any options I may have to get around it?
Thank you very much!
Hey @Jake - this is a bit unfortunate, and we should probably be sorting the field items before returning them.
Nevertheless, you will have to rely on the idCustomField value to tell you which custom field the custom field item value refers.
Basically, you have the "customFields" which can be retrieved from /1/boards/:id/customFields, which is the definition of the fields (name, type, position, id).
That definition (the "customField") is what the customFieldItem.idCustomField refers to, and what you'll need to use to match up which customField the customFieldItem provides a value for.
Sidenote: there's also an Atlassian Developer Community (https://community.developer.atlassian.com/), where API questions might be answered more quickly.
Felix
Would get by custom_field by name a better bet ...not sure this would work...you can try it
next(cf for cf in card_cf_list if cf['name'] == req_field_name)
(note...did not test code)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.