Creates a new Assignment, returns the created Assignment. Checks the authorization status, and checks that the chosen type is compatible with the template of the Issue.

Return

the saved created Assignment

Parameters

authorizationContext

used to check for the required permission

input

defines the Issue, User and optional AssignmentType of the Assignment


suspend fun createAssignment(issue: Issue, user: User, assignmentType: AssignmentType?, atTime: OffsetDateTime, byUser: User): Assignment

Creates a new Assignment on an issue at atTime as byUser. Does not check the authorization status. If present, checks that the assignmentType is compatible with the template of the issue. Does neither save the created Assignment nor the issue. It is necessary to save the issue or returned Assignment afterwards.

Parameters

issue

the Issue to which the user should be assigned

user

the User to assign to issue

assignmentType

the optional type of the created Assignment, must be compatible with the template of issue

atTime

the point in time when the modification happened, updates Issue.lastUpdatedAt if necessary

byUser

the User who caused the update, updates Issue.participants if necessary