Removes an IssueRelation from its Issue, returns the created RemovedOutgoingRelationEvent, or null if the IssueRelation was already removed from its Issue. Checks the authorization status

Return

the saved created RemovedOutgoingRelationEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which IssueRelation to remove


suspend fun removeIssueRelation(issueRelation: IssueRelation, atTime: OffsetDateTime, byUser: User, updateContext: NodeBatchUpdateContext): RemovedOutgoingRelationEvent

Removes an issueRelation from its Issue at atTime as byUser and adds a RemovedOutgoingRelationEvent to the timeline. Also creates a RemovedIncomingRelationEvent and adds it to the timeline of the related Issue. Creates the event even if the issueRelation was already removed from its Issue. Does not check the authorization status. Does neither save the created RemovedOutgoingRelationEvent nor the Issue of the issueRelation. It is necessary to save the Issue of the issueRelation or returned RemovedOutgoingRelationEvent afterwards. Caution: it is also necessary to save the related Issue manually!

Parameters

issueRelation

the IssueRelation to remove from its 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