You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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
Thank you very much Felix, I'll try to implement this and report back :)
I appreciate the response!
Jake
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.