I'm looking to use a post function to create a linked issue using script runner, trying to figure out how I could replace the description of the new issue with last comment.
If you are using the "clones issue" built-in post-function, you can enter the following code into the additional issue actions:
import com.atlassian.jira.component.ComponentAccessor def commentManager = ComponentAccessor.getCommentManager() def comments = commentManager.getComments(sourceIssue) if (comments) { issue.description = comments.last().body } else { issue.description = "No comment set on source issue" }
Another Question, This transition is using a screen with the comment field, I would like to replace the description of the linked issue with this comment only when the comment is not empty.
get the comments in the same way as above but using "issue", not sourceIssue.
in a transition, the current comment is in: transientVars["comment"] - so if that's empty no comment was added
It looks like you're new here. Sign in or register to get started.