Removes an Issue from a Trackable, returns the created RemovedFromPinnedIssuesEvent, or null if the Issue was not pinned on the Trackable. Also removes Labels and Artefacts if necessary, and unpins it on the specified Trackable. Checks the authorization status, checks that the Issue remains on at least one Trackable.

Return

the saved created RemovedFromTrackableEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which Issue to remove from which Trackable


suspend fun removeIssueFromTrackable(issue: Issue, trackable: Trackable, atTime: OffsetDateTime, byUser: User, updateContext: NodeBatchUpdateContext): RemovedFromTrackableEvent

Removes an issue from a trackable at atTime as byUser and adds a RemovedFromTrackableEvent to the timeline. Also removes Labels and Artefacts if necessary, and unpins it on the specified Trackable. Creates the event even if the issue was not on the trackable. Only removes the issue from the trackable if no newer timeline item exists which adds it again. Does not check the authorization status. Checks that the issue remains on at least one Trackable. Does neither save the created RemovedFromTrackableEvent nor the issue. It is necessary to save the issue or returned RemovedFromTrackableEvent afterwards.

Parameters

issue

the Issue to remove from trackable

trackable

the Trackable where issue should be removed

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