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
used to check for the required permission
defines the new state and of which issue to change it
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
the Issue where the state should be changed
the old state
the new state
the point in time when the modification happened, updates Issue.lastUpdatedAt if necessary
the User who caused the update, updates Issue.participants if necessary
context used for the aggregation updater (if not provided, no aggregation is done)