Changes the value of a templated field on an Issue, returns the created TemplatedFieldChangedEvent or null if the value of the templated field was not changed. Checks the authorization status, and checks that the field exists and the value is compatible.

Return

the saved created TemplatedFieldChangedEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines the name and new value of the templated field to update


suspend fun changeIssueTemplatedField(issue: Issue, field: JSONFieldInput, oldValue: String?, atTime: OffsetDateTime, byUser: User): TemplatedFieldChangedEvent

Changes the value of a templated field on an issue at atTime as byUser and adds a TemplatedFieldChangedEvent to the timeline. Creates the event even if the templated field was not changed. Only changes the value of the templated field if no newer timeline item exists which changes it. Does not check the authorization status. Checks that the templated field exists and that the value is compatible. Does neither save the created TemplatedFieldChangedEvent nor the issue. It is necessary to save the issue or returned TemplatedFieldChangedEvent afterwards.

Parameters

issue

the Issue where a templated field should be changed

field

defines the name and new value of the templated field to update

oldValue

the old value of the templated field in serialized form

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