Removes a Artefact from an Issue, returns the created RemovedArtefactEvent, or null if the Artefact was not present on the Issue. Checks the authorization status

Return

the saved created RemovedArtefactEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which Artefact to remove from which Issue


suspend fun removeArtefactFromIssue(issue: Issue, artefact: Artefact, atTime: OffsetDateTime, byUser: User): RemovedArtefactEvent

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

Parameters

issue

the Issue where artefact is removed from

artefact

the Artefact to remove

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