Pins an Issue on a Trackable, returns the created AddedToPinnedIssuesEvent, or null if the Issue was already pinned on the Trackable. Checks the authorization status, checks that the Issue can be pinned on the Trackable

Return

the saved created AddedToPinnedIssuesEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which Issue to pin on which Trackable


suspend fun addIssueToPinnedIssues(issue: Issue, trackable: Trackable, atTime: OffsetDateTime, byUser: User): AddedToPinnedIssuesEvent

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

Parameters

issue

the Issue to pin

trackable

the Trackable where the issue should be pinned

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

Throws