Hello Community,
I have a Rest EndPoint that a user recieves via email for them to click on.
The Rest EndPoint does some processing and pretty much sets some fields in Jira without the user needing to log-in.
So far I am able to have an issue transition based on the Rest EndPoint user clicks, as well as delete a few custom fields based on which Rest EndPoint user clicks as well.
In my Rest EndPoint I have code that automatically adds the a comment to the issue with some standard information. I've tested out my code and everything works when the user accepts via email and just happens to be logged into Jira.
When the user is not logged into Jira and accepts via email everything works except for posting a comment in the issue. Below is my code:
def value = "Thank you for utilizing our email feature"
ApplicationUser user = userManager.getUserByName("userNamePassedViaRestEndPoint")
IssueService issueService = ComponentAccessor.getComponent(IssueService);
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.setComment(value);
def update = issueService.validateUpdate(user, issue.getId(), issueInputParameters)
if (update.isValid()) {
issueService.update(user, update)
}
I am not sure why this code only runs correctly when the user is logged into Jira as well.
Can anyone provide me some insight as to what I need to change or why this is behaving in such a matter.
Thank you!
-Roberto