Adds an AffectedByIssue to an Issue, returns the created AddedAffectedEntityEvent, or null if the AffectedByIssue was already on the Issue. Checks the authorization status.

Return

the saved created AddedAffectedEntityEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which AffectedByIssue to add to which Issue


suspend fun addAffectedEntityToIssue(issue: Issue, affectedEntity: AffectedByIssue, atTime: OffsetDateTime, byUser: User, updateContext: NodeBatchUpdateContext): AddedAffectedEntityEvent

Adds an affectedEntity to an issue at atTime as byUser and adds a AddedAffectedEntityEvent to the timeline. Creates the event even if the affectedEntity was already affected by the issue. Only adds the affectedEntity to the affects on the issue if no newer timeline item exists which removes it again. Does not check the authorization status. Does neither save the created AddedToPinnedIssuesEvent nor the issue. It is necessary to save the issue or returned AddedAffectedEntityEvent afterwards.

Parameters

issue

the Issue which should affect affectedEntity

affectedEntity

the AffectedByIssue which should be affected by the 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

updateContext

context used for the aggregation updater

Throws