Changes the template of an Issue, return the created TemplateChangedEvent or null if the Issue was already pinned on the Trackable. Checks the authorization status, checks that all inputs are compatible with the new template.

Return

the saved created TemplateChangedEvent or null if no event was created

Parameters

authorizationContext

used to check for the required permission

input

defines the new IssueTemplate and of which Issue to change it


suspend fun changeIssueTemplate(issue: Issue, oldTemplate: IssueTemplate, newTemplate: IssueTemplate, templatedFields: List<JSONFieldInput>, type: IssueType?, state: IssueState?, priority: IssuePriority?, assignmentTypeMapping: Map<AssignmentType, AssignmentType?>, issueRelationTypeMapping: Map<IssueRelationType, IssueRelationType?>, atTime: OffsetDateTime, byUser: User, updateContext: NodeBatchUpdateContext): TemplateChangedEvent

Changes the template of an Issue, return the created TemplateChangedEvent. Also creates the TemplateChangedEvent if the template of the issue does not change. Uses templatedFields, type, state, priority, assignmentTypeMapping and issueRelationTypeMapping to enforce compatibility with the new template, however only updates fields which are incompatible with the new template. Does not check the authorization status. Checks that all inputs are compatible with the new template, and checks that the templatedFields are valid after the update.

Return

the created TemplateChangedEvent

Parameters

issue

the Issue to update the template of

oldTemplate

the old template of the issue

newTemplate

the new template of the issue

templatedFields

values to update incompatible templated fields

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

assignmentTypeMapping

used to map incompatible AssignmentTypes

issueRelationTypeMapping

used to map incompatible IssueRelationTypes

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