Accessing archived Items in a board via monday API

I am looking for accessing archived items from an active board (not archived board) via Monday API (not via UI). How do I do that?
I see that on the manual Item has a field called “state” which provides the state of the board. So it is always active in this scenario as I have only archived single item. Any help is greatly appreciated.

1 Like

Hi @spb,

There is no value for state in the argument to query items which means you can’t filter based on the item state.

You would need to collect all items, and then filter by state in your application logic.

1 Like

Hey @mitchell.hudson ,

Thanks for helping out here! :slight_smile: We really appreciate your assistance throughout the community.

-Alex

Hi @mitchell.hudson/@AlexSavchuk,
Correct. But what I am saying is, let’s say I archive an item like this:


Now those items can be seen here on UI

But when I query on API to get all the items:

{
       "query": "{boards(ids:xxxxxx){ items() { id name group { title}  state }  } }"
 }

I cant see those archived data.

I also tried to do this:

   {
          "query": "{boards(ids:xxxxxx,state:all){ items() { id name group { title}  state }  } }"
    }

I know this is query is to include archived and deleted boards as well (not archived items in an active board). But I still went ahead and tried. But I still cant find the archived items.
What should be the correct query?

@spb

I have just done a bit of testing, and it seems you are correct. The boards query does not return archived items. I don’t see a way to alter the default behaviour of this as this stage.

I have found two other workarounds, however they do both have limitations.
The first is using the `items_by_column_values’ query.

{
  items_by_column_values(state: archived, board_id: BOARD_ID, column_id:"COLUMN_ID", column_value:"COLUMN_VALUE") {
    id
    state
    board {
      id
    }
  }
}

This does require a column_id and column_value field in the query. You could potentially have a hidden column on the board and then query this value, you would set a default value or just make it null and query this. This option is probably better as you can filter by board.

The other option is to use the items query.

This would essentially return all items in your monday account, and then you would need to filter them by state and board in your application logic, this would be pretty expensive as you would need to make multiple API calls and loop over every item just to filter the results.

@AlexSavchuk Do you have any other ideas on how to achieve this?

As there is an option for a state argument on the boards query, this may be something that is implemented at a later date.

2 Likes

I am having the same issues with not being able to query archived groups as well. Boosting the signal for Monday.com support.

Hey @mitchell.hudson / @arnold_wikey - my apologies for the delay on getting back on this.

As you’ve seen this isn’t something that is possible right now. The ‘boards’ query does have an argument for the state of the items, but at this time it is not able to pull archived items. It’s something we’ve passed along to our developers internally as feedback, as we too would like to see the ability to query archived items in the future. That being said, I can’t really offer an ETA on this at the moment.

The closest workaround at the moment would be something like what Mitchell listed above using either the column values or items query, although both do have limitations.

Let me know if I can assist with anything else.

-Daniel

So I want to preface this by saying in general, I’m a huge Monday fan, and have generally enjoyed it both from the UI and API side.

That said, this is an absolute dealbreaker for me, and singlehandedly would make me push pretty hard to move off of the platform. Here’s an example workflow:

  • We organize teams by board – eg. “Article Production Team” has a board, so on, so forth.
  • Within boards, we use groups to represent sprints. Sprints last two weeks.
  • After a sprint is complete, we keep it active on the board for a month, and then archive it.
  • We still want to be able to calculate metrics on previous sprints, so in the absence of any built in reporting on the UI side, I go to try to pull a list of all issues within a board… and I can’t.

This means things like mean time to triage, mean time to resolve, distribution of issues between teams – all of these things are actually impossible for me to get any data on, simply because I can’t tell the API to include items from archived groups. I understand we might be operating at the fringes of what Monday is supposed to handle as a platform, but without being able to even get the basics (how many pulses with type Bug did we open this year?), I’m basically flying totally blind without having to materialize the data myself on some cadence and then hope that archived items don’t change.

Honestly, like I said, I generally genuinely enjoy the platform, but without this getting fixed, I pretty much have to move elsewhere, because I can’t in good faith tell stakeholders throughout the company “I think we fix these things pretty fast, and I think these initiatives cut down on these type of issues being submitted, but really no way to tell, sorry!” @dsilva I know you mentioned there’s no ETA, but I need to throw my voice into the ring here that without this being available as part of the API, there’s almost certainly no way we end up using Monday to the depth that we do today.

Please let us know if there’s anything I can do to help clarify, as it’s in my best interest to see this one get fixed. Thanks.