Changes the state of an Issue, returns the created StateChangedEvent or null if the state was not changed. Checks the authorization status, and checks that the new IssueState can be used on the Issue

Return

the saved created StateChangedEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines the new state and of which issue to change it


suspend fun changeIssueState(issue: Issue, oldState: IssueState, newState: IssueState, atTime: OffsetDateTime, byUser: User, updateContext: NodeBatchUpdateContext?): StateChangedEvent

Changes the state of an issue at atTime as byUser and adds a StateChangedEvent to the timeline. Creates the event even if the state was not changed. Only changes the state if no newer timeline item exists which changes it. Does not check the authorization status. Checks that the newState can be used with the issue. Does neither save the created StateChangedEvent nor the issue. It is necessary to save the issue or returned StateChangedEvent afterwards.

Parameters

issue

the Issue where the state should be changed

oldState

the old state

newState

the new state

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 (if not provided, no aggregation is done)