Removes an AffectedByIssue from an Issue, returns the created RemovedAffectedEntityEvent, or null if the AffectedByIssue was not affected by the Issue. Checks the authorization status

Return

the saved created RemovedAffectedEntityEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which AffectedByIssue to remove from which Issue


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

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

Parameters

issue

the Issue which no longer should affect affectedEntity

affectedEntity

the AffectedByIssue which should be removed from the affected entities on 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