Adds an Issue to a Trackable, returns the created AddedToTrackableEvent, or null if the Issue was already on the Trackable. Checks the authorization status

Return

the saved created AddedToTrackableEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which Issue to add to which Trackable


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

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

Parameters

issue

the Issue to add to trackable

trackable

the Trackable where the issue should be added

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