New mutations: add/remove_to/from_column_value

This is a request for two mutations:

add_to_column_value and remove_from_column_value

This would be used for people, dropdown, and tags columns, it would take a normal array of values and add them or remove them from the existing column value.

This isn’t just a shorthand - this is needed to resolve potential race conditions with the API.

To change these three column values, you must write the existing column value with or without the add or removed entities. This requires getting the existing value, and modifying the array and then changing the column with the new value.

Because of the way integrations/automations work, there is a possibility for several different recipes that do not have any awareness of each other (entirely different devs) to be acting simultaneously. Both get the current value and manipulate it, then write their new values - one succeeds, and then is immediately replaced by the other.

This could also be used for board_relation and dependency however these columns have different considerations (since linked items are now first order properties of items - and the columns just act as filters to expose only those connections associated with the column).

Thanks for the request @codyfrisch! I’ve submitted it to the team :slight_smile:

I second this request! Much needed functionality!

1 Like

Make sure to add your vote at the top :slight_smile:

@rachelatmonday can you submit a modification of this request to the team

rather than separate mutations, expand the mutation objects for these types where add/remove are relevant like the following:

{
  dropdown: { add_labels: ["label", "label3"], remove_labels: ["label2"] },
  board_relation: { add_item_ids: ["123123"], remove_item_ids: ["543543"] }
}

The functionality should be obvious.

The add/remove would be unions with the existing labels (or other values) or if a labels key is specified, unions with that rather than existing value. Alternatively it could be an error to mix add/remove and the standard labels.

This way we can do other mutations in the same request.