On Jira Software Cloud, I'm using the ScriptRunner Clone Issue Post Function to create a child issue automatically.
In the 'Additional Code' section I can update some fields for the cloned issue, for example:
issueInput.fields.summary = "Prefix " + issueInput.fields.summary;
However, I cannot seem to set a comment on the to-be-created cloned issue.
On Server, this was done as:
doAfterCreate = {
// Add Comment
// dispatch an event after creating the comment
final<span> </span>boolean dispatchEvent = true
// the body of the comment
final String commentBody =<span> </span>"Auto-generated Issue"
// the author of the comment will be the logged in user
def author = ComponentAccessor.jiraAuthenticationContext.loggedInUser
ComponentAccessor.commentManager.create(issue, author, commentBody, dispatchEvent)
// Update Issue
issueManager.updateIssue(loggedInUser, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
}
What is the way to do this in ScriptRunner for Jira Cloud?
I appreciate your help!