Creates a new IssueRelation, returns the created IssueRelation. Checks the authorization status, and checks that the chosen type is compatible with the template of the Issue.

Return

the saved created IssueRelation

Parameters

authorizationContext

used to check for the required permission

input

defines the Issue, User and optional IssueRelationType of the IssueRelation


suspend fun createIssueRelation(issue: Issue, relatedIssue: Issue, issueRelationType: IssueRelationType?, atTime: OffsetDateTime, byUser: User, updateContext: NodeBatchUpdateContext): IssueRelation

Creates a new IssueRelation from issue to relatedIssue at atTime as byUser and adds it to the timeline of issue. Also creates a RelatedByIssueEvent and adds it to the timeline of relatedIssue. Does not check the authorization status. If present, checks that the issueRelationType is compatible with the template of the issue. Does neither save the created IssueRelation nor the issue. It is necessary to save the issue or returned IssueRelation afterwards.

Parameters

issue

the Issue from which the created IssueRelation starts

relatedIssue

the Issue where the created IssueRelation ends

issueRelationType

the optional type of the created IssueRelation, must be compatible with the template of issue

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