projectsForUser

Syntax

projectsForUser(user, roles)

Description

Returns all the projects where this user has permission to assign or to be assigned issues.

Parameters

Parameter name

Type

Required

Description

user

String

Yes

Username or userkey of the user that is verified.

rolesString[]NoRoles the user must have.

Return type

string []

Returns a list of project keys where the user denoted by the specified username or userkey has permission to assign or to be assigned issues.

If the second parameter is available, it returns a list of project keys where the user is available in one of the specified roles.

Example

Example 1

Results: The following string is returned: You are allowed to work on the following projects: PRJ1, PRJ2, PRJ8Check the values on the next row beginning with <StringPrintRoutine>.

Example 2

Results: Returns an array containing the keys of all the projects where the user has permission to assign issues or has the permission issues to be assigned.

Example 3

Results: Returns an array containing the keys of all the projects where the user is in role of Administrator or Developer.

Notes:

See also