I need to add comment with attachments names and this script has to work on issue create transition. I found out how get attachments of not yet created issue https://scriptrunner.adaptavist.com/5.0.17/jira/recipes/workflow/validators/validate-attachments-links-in-transition.html but can't add comment.
commentManager.create(issue, currentUser, attachNames.toString(), true)
issue is null here so I have illegal argument exception
Perhaps your post function occurs too early in the list of post functions. On a Create, the first post function by default is Creates the issue originally. If you place a post function before that (that attempts to write a comment, etc.), then as you find, the issue does not yet exist. Try moving your post function down in order, using the arrow icons that appear when you hover over the post functions.
Thanks, it works. And I don't have to get attachments names so difficult way, i just can
def attachManager = ComponentAccessor.getAttachmentManager()
def attachs = attachManager.getAttachments(issue)
without TemporaryWebAttachmentManager
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.