Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,7 @@ public static FormBody.Builder toForm(SlackListsItemsCreateRequest req) {
setIfNotNull("parent_item_id", req.getParentItemId(), form);
if (req.getInitialFields() != null) {
String json = getJsonWithGsonAnonymInnerClassHandling(req.getInitialFields());
form.add("intial_fields", json);
form.add("initial_fields", json);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Nice catch 🎉 Silent param-drops are the worst flavour of bug because nothing 4xxs and the request just succeeds with the field missing.

}
return form;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ public void fullSlackListsWorkflow() throws IOException, SlackApiException {
assertThat(createItemResponse.getError(), is(nullValue()));
assertThat(createItemResponse.isOk(), is(true));
assertThat(createItemResponse.getItem(), is(notNullValue()));
assertThat(createItemResponse.getItem().getFields(), is(notNullValue()));
assertThat(createItemResponse.getItem().getFields().size(), is(1));
assertThat(createItemResponse.getItem().getFields().get(0).getColumnId(), is(taskNameColId));
assertThat(createItemResponse.getItem().getFields().get(0).getText(), is("Test task item"));
Comment on lines +164 to +167

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪬 note: We now confirm the fields used above:

[DEBUG] createItemResponse item=ListRecord(id=Rec0B9VCSAABE, listId=F0B9KD6NECB, fields=[ListRecord.Field(key=task_name, columnId=Col0B9TKAUTND, value=[{"type":"rich_text","block_id":"h2z2t","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"Test task item"}]}]}], text=Test task item, richText=[RichTextBlock(type=rich_text, elements=[RichTextSectionElement(type=rich_text_section, elements=[RichTextSectionElement.Text(type=text, text=Test task item, style=null)])], blockId=h2z2t)], messages=null, message=null, number=null, select=null, date=null, user=null, attachment=null, checkbox=null, email=null, phone=null, channel=null, rating=null, timestamp=null, link=null, reference=null)], dateCreated=1781134963, createdBy=U09KU686163, threadTs=null, position=null, updatedTimestamp=1781134963, updatedBy=U09KU686163, viewPositions=null, platformRefs=null, isSubscribed=null, saved=null, savedFields=null)


String itemId = createItemResponse.getItem().getId();
assertThat(itemId, is(notNullValue()));
Expand Down