monday icon indicating copy to clipboard operation
monday copied to clipboard

Added mutation for multiple items

Open olegkron opened this issue 2 years ago • 3 comments

Added a function which allows to modify multiple items at once using graphQL's mutation query. The function takes a list of dictionaries with methods and any additional parameters the method requires.

This already saved me hours when working with large sets of data, as the only way to work with multiple items with this library was to call the update/create functions one by one, whereas now you're able to perform multiple operations at once.

Hope you find it as much of a lifesaver too!

items_data = [
    {
        "method": "create_item",
        "board_id": 1437462152,
        "group_id": "new_group",
        "item_name": "New Item",
        "column_values": {"status": "done"},
        "create_labels_if_missing": True
    },
    {
        "method": "change_multiple_column_values",
        "board_id": 1435323152,
        "item_id": 1345543264,
        "column_values": {"status": "done"},
        "create_labels_if_missing": True
    }
]

response = monday.items.mutate_multiple_items(items_data)

olegkron avatar Apr 05 '23 11:04 olegkron

Hi @chdastolfo, please let me know if there's time to review this pull request. Thanks!

olegkron avatar Apr 11 '23 09:04 olegkron

Also! Please add this method to the docs in docs/README.rst

chdastolfo avatar Apr 12 '23 20:04 chdastolfo

@chdastolfo Being able to group mutations/queries is a really useful feature. Are there any plans for this PR to make it into a release?

danielcherrington avatar Jul 04 '24 08:07 danielcherrington