Hello! I'm trying to create comment on servicedesk portal with scriptrunner via workflow postfunction. Problem is that this comment don't become visible on Service Desk portal, and visible only on "browse issue" screen. Can anybody help ?
Here is code:
import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.util.json.JSONObject
String messageToAdd = "We got your request and will answer you ASAP";
final SD_PUBLIC_COMMENT = "sd.public.comment";
def properties = [(SD_PUBLIC_COMMENT): (new JSONObject(["internal": false] as Map))];
ApplicationUser johnGalt = ComponentAccessor.getUserManager().getUserByName("jhon.galt");
log.warn("Getted user is " + johnGalt.getName());
ComponentAccessor.getCommentManager().create(issue, johnGalt, messageToAdd, true);