Adds a Artefact to an Issue, returns the created AddedArtefactEvent, or null if the Artefact was already present on the Issue. Checks the authorization status, checks that the Artefact can be added to the Issue

Return

the saved created AddedArtefactEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines which Artefact to add to which Issue


suspend fun addArtefactToIssue(issue: Issue, artefact: Artefact, atTime: OffsetDateTime, byUser: User): AddedArtefactEvent

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

Return

the crated AddedArtefactEvent

Parameters

issue

the Issue where artefact is added to

artefact

the Artefact to add

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

if the artefact cannot be added to the issue