Module: job_role

Copyright 2020 Parsable, Inc
API address: /api/job_roles
Job Role management. Job roles are roles in the context of a job, such that different steps can be assigned to different roles.

ModuleServicesData typesConstants
job_roleJobRoleService
AllRolesResult
DocumentPermissions
IndexOpts
IssuePermissions
JobPermissions
JobRole
JobRoleParams
JobRoleRestriction
JobRoleSelectOpts
PermissionChangeWarning
StepPermissions
SystemRoleType
TemplatePermissions
UserPermissions

Enumerations

Enumeration: SystemRoleType


JOB_CREATOR1
ISSUE_CREATOR2
OBSERVER200 Deprecated *

Data structures

Struct: StepPermissions

KeyFieldTypeDescriptionRequirednessDefault value
1addAndDuplicateStepsbooldefault
2addAndDuplicateStepGroupsbooldefault
3markStepsNAbooldefault
4sendFieldInputbooldefault
5completeStepsbooldefault

Struct: UserPermissions

KeyFieldTypeDescriptionRequirednessDefault value
1inviteUsersbooldefault
2removeUsersbooldefault

Struct: TemplatePermissions

KeyFieldTypeDescriptionRequirednessDefault value
1addTemplatesbooldefault
2addSetsbooldefault

Struct: DocumentPermissions

KeyFieldTypeDescriptionRequirednessDefault value
1addbooldefault
2removebooldefault

Struct: IssuePermissions

KeyFieldTypeDescriptionRequirednessDefault value
1createbooldefault
2resolvebooldefault
3inviteUsersbooldefault
4removeUsersbooldefault

Struct: JobPermissions

KeyFieldTypeDescriptionRequirednessDefault value
1editTitlebooldefault
2editMetadatabooldefault
3completebooldefault
4uncompletebooldefault
101stepStepPermissionsdefault
102userUserPermissionsdefault
103templateTemplatePermissionsdefault
104docDocumentPermissionsdefault
105issueIssuePermissionsoptional

Struct: IndexOpts

KeyFieldTypeDescriptionRequirednessDefault value
1showArchivedboolSet showArchived to false to filter out archived jobRoles. Defaults to true defaulttrue

Struct: JobRoleSelectOpts

KeyFieldTypeDescriptionRequirednessDefault value
1includeRestrictedUserModularsboolReturns restricted user ids instead of user modulars when false default
2allUsersboolReturns roles for all users instead of just current user's Only valid for getAllAssignedRoles, and is ignored if user is not a team admin default

Struct: JobRoleRestriction

KeyFieldTypeDescriptionRequirednessDefault value
1restrictedboolWhen creating/updating a job role, if true, restrict to the user ids/emails specified by permitUserIds
When retrieving a job role, it is restricted to the users specified by permittedUsers or permitUserIds based on JobRoleSelectOpts, by default permitUserIds
optional
2permitUserIdslist<string>optional
3permittedUserslist<user.UserModular>optional

Struct: JobRoleParams

KeyFieldTypeDescriptionRequirednessDefault value
1namestringName of the job role optional
2descripstringDescription of the job role optional
3permissionssetting.SettingsFormSettings form for job role permissions. Get by calling settings#indexJobPermissions() optional
4restrictionJobRoleRestrictionRestrictions for this job role optional

Mutable parts of the job role

Struct: JobRole

KeyFieldTypeDescriptionRequirednessDefault value
1idstringUUID of the job role default
2teamIdstringUUID of the associated team default
3namestringName of the job role default
4descripstringDescription of the job role default
5archivedAti64Unix timestamp of when the role was archived. 0 means the role is not archived. default
6systemRoleboolSystem job role, cannot be modified default
7systemRoleTypeSystemRoleTypeKind of system job role (for client-side identification, e.g. for translation) optional
8permissionsJobPermissionsoptional
9restrictionJobRoleRestrictionRestrictions for this job role optional

Struct: PermissionChangeWarning

KeyFieldTypeDescriptionRequirednessDefault value
1unexecutableTemplateIdsset<string>default

Shows the templates and jobs that would be placed in an un-executable state on the given permissions update. I.e. a job role is not longer able to execute a step but there exist steps assigned to that job role.

Struct: AllRolesResult

KeyFieldTypeDescriptionRequirednessDefault value
1userRoleIdsmap<string, list<string>>User id to role id list, all this user's assigned roles on the team default
2idRolesmap<string, JobRole>All the job roles contained in the above map, indexed by job role id default


Services

Service: JobRoleService

Manage job roles.

Function: JobRoleService.index

list<JobRole> index(string teamId,
                    IndexOpts opts,
                    JobRoleSelectOpts selectOpts)
    throws common.SystemException
List all of a team's job roles

Function: JobRoleService.getAllAssignedRoles

AllRolesResult getAllAssignedRoles(string teamId,
                                   JobRoleSelectOpts selectOpts)
    throws common.SystemException
Gets a map of the team's job roles If current user is not a team admin, return only his assigned roles.

Function: JobRoleService.create

JobRole create(string teamId,
               JobRoleParams params)
    throws common.SystemException
Create a new job role Fails with error XXX if name is not unique Fails with error YYY if missing name

Parameters

NameDescription
teamIdTeam to create role for
paramsParameters for the job role

Function: JobRoleService.update

JobRole update(string roleId,
               JobRoleParams params)
    throws common.SystemException
Fails with error XXX if name is not unique

Parameters

NameDescription
roleIdId of job role
paramsParameters for the job role

Function: JobRoleService.validatePermissionsForm

PermissionChangeWarning validatePermissionsForm(string roleId,
                                                setting.SettingsForm permissions)
    throws common.SystemException
Validate the contents of the job role permissions form. See PermissionChangeWarning for details about warnings.

Function: JobRoleService.get

JobRole get(string roleId,
            JobRoleSelectOpts selectOpts)
    throws common.SystemException
Get a job role

Function: JobRoleService.archive

JobRole archive(string jobRoleId)
    throws common.SystemException
Archive a job role. Archived job roles can no longer be assigned in future jobs. They will still function normally in existing jobs.

Function: JobRoleService.unarchive

JobRole unarchive(string jobRoleId)
    throws common.SystemException
Unarchive a job role.

Function: JobRoleService.getPermissionsSettings

setting.SettingsForm getPermissionsSettings(string jobRoleId)
    throws common.SystemException
Get the current permissions form for a job role