Moving items from one board - to become subitems of another board?

Let’s say I have a board that has items such as this:
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6

Now let’s give them a column and some column_values
Item 1 [Project A]
Item 2 [Project B]
Item 3 [Project B]
Item 4 [Project A]
Item 5 [Project A]
Item 6 [Project B]

Now lets say I have another board, that tracks the overall projects. Right now - it only has two items in it:
Project A
Project B

Is there a way for me to, by matching criteria of a column_value to an item name, push all items from my first board as subitems to my second board? In this scenario, the desired result would look like this, with “-” meaning sub-item:

Project A
-Item 1
-Item 4
-Item 5
Project B
-Item 2
-Item 3
-Item 6

I am considering writing a NodeJS script to do this for me - but before I begin I’m wondering if this is already possible and I’m just not seeing it? I’ve messed around with “When an item is created” → “create item in board & connect boards”. But it’s not really what I need as you can see. Furthermore, even if I did go that route - then I use the automation “When an item is moved to this board” → “Then create a subitem”… but this isn’t really what I’m looking for either.

Essentially - It’s a problem of one board being the database for another board.

Any suggestions or considerations please let me know.

6 Likes

We have a similar need here, I am looking forward to seeing the responses to this.

1 Like

@Dylan.townes @JanieKustaborder

This is an interesting idea. What would you want the trigger to be?


Jim - The Monday Man
Get Custom Apps, Integrations & Automations for monday

In our situation, we have a plugin that imports items from ADO. ADO User Stories have ADO tasks under them, so we would want task items to be subitems of the associated user story.

The trigger could be when a task is imported.

Essentially - to make it a feature usable by anyone- it would look something like this.

Let’s say Item1 is from board 1, and item 2 is from board 2. You want the items in board 1 to become subitems in board 2 by way of some matching criteria. Maybe they share a similar column value, or name, or status, or whatever.

if item1 coulmn_value = item2 column_value
then mutation{ create_subitem (parent_item_id: {item2}, item_name: "item1"}

You can further adjust the mutation to carry over whichever column values from each item you would like - into new column values.

For expansion on this, this is what it would look like - very abstracted in no particular language.

Q1 - Query{boards (ids:{board1 id}) { items{ name { column_values{ value name id } } } }
Q2 - Query{boards (ids:{board2 id}) { items{ name { column_values{ value name id } } } }

Then to create the matching criteria tool we’d need a function that lets a user decide what value they’d like to match for the criteria of the mutation function.


matchingCriteriaToolWithMutation(){
A = Q1
B = Q2
for(i = 0; i < A.boards[0].items.length; i++){
if(A.data.boards[0].items[i].column_values[i].value == B.data.boards[0].items[i].column_values[i].value){
then mutation{ create_subitem (parent_item_id: ({B.data.boards[0].item[i].id}), item_name: {A.data.boards[0].items[i].name}
}
}

And so no and so fourth - This is of-course matching based on a column_value that is hard coded in this case you would want to ask the user what matching criteria between items you would like to create the subitem tool to function on. The function above also assumes the returned arrays from both queries are exactly the same length which ofcourse won’t work. Above is just an extremally rough demonstration of what I’m trying to achieve here.

“Between Board 1 and Board 2, which criteria determines which items from Board 1 become subitems of items on Board 2”

Again it’s just the problem of one board being the database for another board. You might ask, then why not just have both boards together in the first place? why did the user get themselves into the situation of using two boards for the same data set? Well in our case it’s because we need the full functionality of items for both boards, not subitems. And groups also don’t have enough functionality to meet the demands necessary.

3 Likes

I would love a feature like this for my CRM Workspace that allows me to link individual contacts in a raw data area as sub items to the respective Customer/Company when that column is updated. It will also be highly valuable when we develop the project management section of our Monday instance.

1 Like

Dylan - dd you manage to create this? It’s exactly what I need! If so, could yo share the code AND let me know how to use it (I’m not clever with fiddling under the bonnet!)

Cheers!

Dave

Did you manage to create this? It’s exactly what I need! If so, could yo share the code AND let me know how to use it (I’m not clever with fiddling under the bonnet!)

Cheers!

Dave