chrisman / pdqq

Pretty Darn Quick Queue
0 stars 0 forks source link

Investigate custom/required fields for cards #1

Open chrisman opened 6 years ago

chrisman commented 6 years ago
squeemishly commented 6 years ago

creating cards by email

squeemishly commented 6 years ago

add custom fields via API

squeemishly commented 6 years ago

Summary:

Required Fields

I don't think it's possible to create a required field. But we could work around that by making required fields in our Form that are then used to populate the API call.

Custom Fields

Creating a custom field might be a little complicated. It looks like we'll need to create the card, and then get the ID of the card back from Trello. Then use the ID of the card to add a custom field to it.

curl -X POST -H "Content-Type: application/json" \
https://api.trello.com/1/customFields \
-d '{
  idModel: "5a00adcebe1991022b4a4bb4",
  modelType: "board",
  name: "My Dropdown",
  options: [,
    {
      color: "none",
      value: {
        text: "First Option"
      }, 
      pos: 1024
    },
    {
      color: "none",
      value: {
        text: "Second Option"
      }, 
      pos: 2048
    }
  ],
  pos: "bottom",
  type: "list",
  display_cardFront: false
}'

Attachments

Also, I couldn't find a conclusive way of making an API call for attachments. I do think it's possible, but I need to play with the code some to test it. In the mean time, it also looks like we can make cards via email, and the attachment process on that is SUPER simple. Email doesn't offer anywhere near the level of robust options we need, but it is super cool...