AtTask API get assigned users - api

We have multiple people assigned to a single ticket but when using the assignedToID field, it just returns the first user?.. Why is it not returning an array of user ids?
I know this is off-topic but is it possible to get user's name also and not just id?

To get a list of users you can user assignmentsListString
to pull user names instead of IDs you should be able to use
assignedTo:name
example
/attask/api/v4.0/task/54d25b43005a2117e6c2d674b932a666?fields=assignmentsListString,assignedTo:name

Related

More efficient way to check if a user is in a group that itself belongs to another group?

We have groups that represent where the user is providing coverage, each user belongs to one group. Rather than put this in a database table that needs to be maintained I am trying to use the Microsoft Graph API. It is working well, except it now takes 10-12 seconds to load the page where this is done. When I pull this out, it's down to 3 seconds which is because of another API, so I believe it to be the culprit.
So let's say user Jane belongs to "NorthEast" group, which belongs to "Regions" group. So right now I am getting a list of the groups that belong to "Regions" then I am iterating through each user's groups (the big slow down is here) to see if any of them match a group that belongs to "Regions". If one does, then that is their assigned region.
I see MemberOf as a returned item in the list of groups that belong to "Region" but it is always NULL.
List of groups that belong to "Regions":
var members = await graphClient
.Groups["RegionGroupID"]
.Members
.Request()
.GetAsync();
List of a user's groups:
var memberOf = await graphClient
.Users[UserId]
.MemberOf
.Request()
.GetAsync();
I'm not very clear about your business logic, but as you said that you need to get all the "Regions" groups first, and then get all the groups of a specific user, then you may need to use "double for loop" to check if this user has a group which is one of the "Regions" groups.
And you said that the big slow down is here so I think you may try to add the "Region" group value to each user so that you can get the value directly. Let's see user property in graph api. How do you think that you set the "Region" group value to officeLocation or streetAddress? You may go to azure portal to edit them for each user and you can also get this property by graph api.

how to get groups of a user in ldap by members with attribute value

My question is very similar to how to get groups of a user in ldap but I want to be able to search a group whose member has attribute foo with value bar
ie, from the previous question instead of doing (&(objectClass=groupOfNames)(member=cn=root,ou=django,dc=openldap))
I want to do something like
(&(objectClass=groupOfNames)(member=sn=bar))
but it seems only the full DN can be used for such query. Is there another way to find groups for user matching a pattern?
Since memberOf is available to you, you can search for the users instead of the groups:
(&(objectClass=person)(sn=bar))
(You might have to change the objectClass depending on what it is for users. I'm used to Active Directory, not OpenLDAP.)
Then you can read the memberOf attribute of the users you find.
Update: If you just want to find members of that group with that attribute then you can do it in one query by using memberOf in the query, and looking for the DN of the group:
(&(objectClass=person)(sn=bar)(memberOf=CN=MyGroup,DC=whatever))

Searching for a user and associated groups on LDAP in one search

New to LDAP. The way our LDAP is arranged is People and groups. The people have user information such as name, uid, and mail. The groups have group name and multiple member field which has value like cn=First Last,cn=people,dc=comic,dc=com, listing the People that are members of the group.
Currently starting with userid and password, doing two searches:
1) Get user by searching on People base domain on uid=value. Then from the user get the first and last name.
2) Search on Groups base domain based on member=cn=First Last,cn=People,dc=comic,dc=com and iterate over the list of group objects returned to the group name field.
Am just wondering is there way to do all this in one search or are two searches necessary?
Unfortunately you cannot do what would like in one operation.
Also, what you are doing will not always work. Instead of retrieving the users first and last name you should retrieve their distinguished name (dn attribute) and do your group search based on that. First and last names can be modified within LDAP and can happen due to marriage / divorce / etc.
It is possible, provided that you implement a Reverse Group Membership Maintenance Overlay.
To determine which groups an entry is a member of without performing extra searches, the memberOf overlay is exactly what you need.
The memberof overlay updates an attribute (by default memberOf)
whenever changes occur to the membership attribute (by default member)
of entries of the objectclass (by default groupOfNames) configured to
trigger updates. Thus, it provides maintenance of the list of groups
an entry is a member of, when usual maintenance of groups is done by
modifying the members on the group entry.
You may find this Server Fault post useful for a how to.
Once you have memberOf attribute ready to be used, you may have to run ldapmodify manually on each group entries, but just once, so that all members entries can be provisioned with the corresponding group dn in their respective memberOf attribute.
Finally, to perform a group membership search for a given user, you would just search for the user entry and iterate the memberOf attribute to get group dn's.

How to list users which belongs to specific group in ldap without backlink enabled

What is the search filter to list users belong to specific group like "engineering" in a ldap server which don't have backlink enabled.
For example, if backlink enabled i can use following filter,
(&(objectClass=person)(memberOf=cn=engineering,ou=Groups,o=company,o=com))
Wanted to know corresponding search query without using memberOf attribute.
Thanks
DarRay
Try your filter as:
(&(objectClass=group)(cn=engineering))
using a base of
ou=Groups,o=company,o=com
and a scope of subtree
Returning attribute "member"
Or even more efficient:
(objectClass=group)
With a base of
cn=engineering,ou=Groups,o=company,o=com
and a scope of base
Returning attribute "member"
-jim
The main question is: How are the users linked to groups?
One way is by specifying the users as attributes in the group. That can be done either via the uniqueMember- or the memberUid-Attribute. To find the users of a certain group you will have to use two queries. One query will retrieve the DNs or UIDs of the users of a group by fetching the uniqueMember or memberUid attribute of the group in question depending on your setup. Then you can retrieve the users by either using (&(objectclass=person)(uid=<uid>)) or (&(objectclass=person)(dn=<dn>)).
The other way is by storing the grous as attributes in the user, which you described above.
Hope that helps.

fetching user media from instagram api without user id

I did what #krisrak told me to do. I used two API calls.
One to search for the username with
https://api.instagram.com/v1/users/search?count=1&q=USERNAME
and i got the user id from there to perform the second API call
The second call was
https://api.instagram.com/v1/users/USER-ID/media/recent/
This worked perfectly until I searched a certain username and I was given another. So I want to know if there's a sort of where clause to use to get the username I want from a list of results gotten. So my 1st call would now be
https://api.instagram.com/v1/users/search?count=0&q=USERNAME
to enable me get all results.
If there is no match, then that username probably does not exists, go to instagram.com/USERNAME and check if it exists. You may have to ignore and display that username does not exist.
BTW to get all the results, just remove count=1, then it will return a bunch of usernames that match similar search, usually the first one will be the exact match, so thats the reason count=1 is used to match a particular username.
https://api.instagram.com/v1/users/search?q=USERNAME