private suspend fun updateIssueFieldsAfterTemplateUpdate(issue: Issue, event: TemplateChangedEvent, type: IssueType?, state: IssueState?, priority: IssuePriority?, atTime: OffsetDateTime, byUser: User)

Updates type, state, and priority on issue after a template update if the old value is incompatible with the new template. Adds the crated events to childItems on event

Parameters

issue

the Issue of which the template was updated

event

the event representing the template update

type

new IssueType in case existing one is incompatible

state

new IssueState in case existing one is incompatible

priority

new IssuePriority in case existing one is incompatible

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