I’m trying to use the Monday.com API to create a new item with the Assigned To field prepopulated with a specific user.
I can currently create new items via the API without the Assigned To field set but with other fields set with the following type of query:
mutation {
create_item (
board_id: xxxxxxxxx,
group_id: "some-group-id",
item_name: "Testing",
column_values: "{\"text0\":\"Some text\",\"text1\":\"Some other text\"}"
) {
id
}
}
The problem I think I’m having is that the column_values
value is already an escaped JSON string, and within that, I’d have to add another (escaped?) JSON string for the Assigned To field.
At this point, I’ve tried every combination I can think of, but nothing seems to work. Here’s an example of what I’ve tried:
mutation {
create_item (
board_id: xxxxxxxxx,
group_id: "some-group-id",
item_name: "Testing",
column_values: "{\"text0\":\"Some text\",\"text1\":\"Some other text\",\"people\":\"{\\\"personsAndTeams\\\":[{\\\"id\\\":xxxxxxxx,\\\"kind\\\":\\\"person\\\"}]}\"}"
) {
id
}
}
That does not work though.
If it matters, I’m currently just testing this with Postman and trying to send the data with a GraphQL body set like the above examples, and while the first example without the Assigned To field set works and correctly creates a new item, the second one doesn’t.
What am I missing / doing wrong? Thank you.