private suspend fun <T, E : TimelineItem> changeIssueProperty(authorizationContext: GropiusAuthorizationContext, issue: Issue, currentValue: T, newValue: T, internalFunction: suspend (issue: Issue, oldValue: T, newValue: T, atTime: OffsetDateTime, byUser: User, updateContext: NodeBatchUpdateContext) -> E): E?

Changes a property of issue, returns the created event or null if the property was not changed. Checks the authorization status (TrackablePermission.MANAGE_ISSUES on the issue)

Return

the saved created event or null if no event was created

Parameters

authorizationContext

used to check for the required permission

issue

the Issue to update

currentValue

the current value of the property

newValue

the new value of the property

internalFunction

used to create the returned event and apply the change

Type Parameters

T

the type of the property

E

the type of the timeline item


private inline suspend fun <T, E : TimelineItem> changeIssueProperty(issue: Issue, newValue: T, atTime: OffsetDateTime, byUser: User, property: KMutableProperty0<T>, event: E)

Changes a property of an issue at atTime as byUser and adds the event to the timeline. Only changes the property if no newer timeline item exists which changes it. Does not check the authorization status. Does neither save the event nor the issue. Calls createdTimelineItem on the event.

Parameters

issue

the Issue where the spentTime should be changed

newValue

the new value of the property

atTime

the point in time when the modification happened, updates Issue.lastUpdatedAt if necessary

property

the property on the issue

event

the already created TimelineItem for the change

byUser

the User who caused the update, updates Issue.participants if necessary

Type Parameters

T

the type of the property

E

the type of the timeline item