Unable to change comment updateAuthor

Neha Sharma February 18, 2020

Hi,

I have a scriptrunner set up which listens to the issue update events, reads the event comment and updates the comment to a pre-decided format. I want to change the update author of the comment while updating the comment, but I am unable to do so. Even if I use the method eventComment.setUpdateAuthor(superEpicCommenter) - I am unable to change it (it gets updated in the database but not on the UI. I also tried re-indexing the issue after the update but it failed too).

I also tried logging in as a different user and update the comment - this failed too. Can someone please suggest how can I update the author ?

formattedComment += "\n[Comment : " + eventComment.getBody() + "]"
ApplicationUser superEpicCommenter = ComponentAccessor.getUserManager().getUserByName("abc");

ComponentAccessor.getJiraAuthenticationContext().setLoggedInUser(superEpicCommenter)
eventComment.setBody(formattedComment);
//eventComment.setUpdateAuthor(superEpicCommenter);
ComponentAccessor.getCommentManager().update(eventComment, false);

Thanks in advance,

Neha

0 answers

Suggest an answer

Log in or Sign up to answer