API : get Items Owner

Hi.
I’m looking for a query that can return me among the other fields of an item also the owner, the person to whom the task was assigned. Can you help me?

Hello there @Antonio.Cirelli.ext and welcome to the community!

I hope you like it here :muscle:

You should get the ID of the people column, and then get the column value for that column, from a specific item.

That will get you the list of users that are assigned in the people column.

Cheers,
Matias

Hi,
too bad that that field is the display name of the assignee. It would have been perfect if I could have found his email. But it is already a good result. Thank you.

Hello again @Antonio.Cirelli.ext!

In the value of the people column you can get the user ID. You can then use that user ID to get the user’s email address:

{
  users(ids:1234567890){
    email
  }
}

Hope this helps!

Cheers,
Matias

ok,
but how can i get the id from people column?

Hello @Antonio.Cirelli.ext!

Like this:

{
  boards(ids: 1234567890) {
    items(ids: 0987654321) {
      column_values(ids: "people_1") {
        value
      }
    }
  }
}

You will have to use your own board ID, item ID and column ID :slightly_smiling_face:

Unfortunately I can not get any value for the column ‘people_1’.


column_values":

I would just have to access the owner’s email, people I suppose

maybe I found a way to get the id of the user and secondly,
by another query i can get the email

{
boards(ids: …) {
items(ids: …) {
column_values(ids: “people”) {

additional_info
}
}
}
}
in additional_info i’ve found the id of the user (let 111). In a second query:

query {
users (ids: [111]) {

email

}
}

I was wondering if there was a more efficient way to get this info, avoiding the two queries

Hello again,

Matias here!

people_1 was the ID of my column, you have to use your own and I believe you realized that and used “people” which I am guessing is the ID of your people column :slightly_smiling_face:

You should find the user ID in the “value” of that column value.

You can not retrieve the email address with one call. You have to use two calls.

Cheers,
Matias