JIRA Api for 'Find users with browse permission ' not working - jira-rest-api

I am trying to get a list of users who have access to a particular issue.
I tried using GET /rest/api/2/user/viewissue/search for this . But it asks for username and issueKey query parameters. Also it is returning only one user.
How does this api work?
I refered to the documentation here: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-user-viewissue-search-get

EDIT to the below: If you query with username=% (i.e. a wildcard) then it returns
every user with permission
As the documentation you've linked to states, you do need to provide an issueKey and a username or it won't return any results:
username
string
the username filter, no users returned if left blank
This is saying, find all the users who have permission to see the specified issue, where their username matches this specific filter value I'm providing, i.e. not all users that have permission.
It's filtering on some combination of username, display name and email (I think).
I have a JIRA Cloud site with three users:
admin, which has a display name of Mike Jones and an email of mike.jones#...
mike, which has a display name of Mike Jones and an email of mike.jones#...
mike.jones, which has a display name of Mike Smith and an email of mike.jones#...
If I run this query, I see all three users returned:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=mike
If I change the last query parameter to be username=smith then I see just the third user with a display name of Mike Smith, which suggests it's querying the Display Name field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=smith
But if I use the parameter username=jones, then I see all three users, which suggests it's querying the Email field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=jones
And if I use the parameter username=admin, then I only see the admin user, which suggests it's querying on the Username field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=admin

Related

LDAP Query to check if User is a member of a particular security group

I am trying to adapt the following query to find out if a user is a member of a specific group (security group) but I do not get it to work and I fail to understand it completely.
(&(objectClass=user)(sAMAccountName=yourUserName)
(memberof=CN=YourGroup,OU=Users,DC=YourDomain,DC=com))
in my case, the user is XYZ and the security group is called [SecITGroup].
The user is however located under OU=USERS OU=GO OU=AzureSync.
I have tried the following:
(&(objectClass=user)(sAMAccountName=XYZ)
(memberof=CN=SecITGroup,OU=AzureSync,OU=GO,OU=USR,DC=de,DC=domain,DC=int))
yes, I set the domain name to the actual domain and No result is shown is displayed.
What is the return attribute am I supposed to get back?
I found a solution or a workaround to this.
The LDAP Query is rather to say show me users in the specific group:
(&(objectCategory=user)(memberOf=CN=Administrators,OU=Admin,OU=Groups,DC=domain,DC=com))
The attribute is sAMAccountname which displays the user's name.

LDAP authentication filter to validate which employee is belong to which group

I am doing LDAP authentication for the user.
Steps are -
1. when users enter his username on the login screen.
2. The request goes to the LDAP server and will try to validate the user against its corresponding group
filter :="(|(employeeNumber=deeps)(memberOf=CN=DEV_Admin,OU=LDAP,DC=TEMP,DC=com))"
This filter works fine and giving me the employee details of the relevant group.
Now the requirement changes -
When the user enters his employeeNumber =deeps
we have to validate him against different groups for example
(memberOf=CN=DEV_Admin,OU=LDAP,DC=TEMP,DC=com)
(memberOf=CN=DEV_View,OU=LDAP,DC=TEMP,DC=com)
(memberOf=CN=DEV_Partial,OU=LDAP,DC=TEMP,DC=com)
Can anyone help me with writing a proper filter which checks against all those groups and gives me the user in one filter rather than writing three LDAP requests?
The filter seems incorrect to me as it tests if the employeeNumber is deeps OR if entries are in the Dev_Admin group. It seems to me that you want an AND, not an OR.
To check the 3 groups, it would be the following filter:
(&(employeeNumber=deeps)(|(memberOf=CN=DEV_Admin,OU=LDAP,DC=TEMP,DC=com)(memberOf=CN=DEV_View,OU=LDAP,DC=TEMP,DC=com)(memberOf=CN=DEV_Partial,OU=LDAP,DC=TEMP,DC=com)))

Defining Logged in Users Details in Oracle

I dont know how to go about defining a set of attributes to a user when they have logged in to Apex. After logging in with their username and password, the tables should display data about that User. The username and password are stored in a table with general details such as 'name','email address','home address etc' with 'Employee_id' being the primary key. When they have logged in they should have that specific row's data values. What I have tried to attempt:
I made a report want to specify the name display:
SELECT NAME
FROM EMPLOYEES
WHERE EMPLOYEE_USERNAME= :APP_USER
(Have tried to get the current logged in username).
This has not worked and nothing is displayed.
For your above query to return data the value of EMPLOYEE_USERNAME must match the current username which is stored in the :APP_USER variable. Please note that :APP_USER retrieves the username of the current user in uppercase. I suggest you change your query like this:
SELECT NAME
FROM EMPLOYEES
WHERE UPPER(EMPLOYEE_USERNAME)= :APP_USER
This type of query has some performance problems i suggest adding a trigger that will ensure the EMPLOYEE_USERNAME is in a uppercase or add a Function Based Index on UPPER(EMPLOYEE_USERNAME).

AtTask API get assigned users

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

What is the best way to lay out nested data in SQL Server Reporting Services 2005?

I am attempting to create a report that contains a list nested within another list to produce the following layout:
User name: Bob
User info: Interesting stuff about Bob
Permissions: Administrator
SuperUser
User
User name: Next user
etc...
The data looks like this:
UserName Details PermissionName
Bob Interes... Administrator
Bob Interes... SuperUser
Bob Interes... User
NextUser More stuff User
In my example I am trying to display the user details using a list and then to display the permissions using a second list embedded within the first list. I decided to do this because there are a variable number of permissions that can be assigned to a user. However this approach doesn't seem to work.
Is there a better way or am I just missing something really obvious?
how about using a sub report for the 2nd set?
You can also use a table control and group your data on "UserName" with the detail grouped on "Permission".