I’m trying to modify an issue, but getting a permission error when I pass null as the user. However, I can’t pass a valid user in, since I’m not running in a context where there is a user (basically a cron job). There isn’t any particular user who can be said to have ‘performed’ the action, so I’d rather just leave the user field empty, but not sure how to bypass the permissions issue.
Here’s my (partial) code at the moment
public void setCustomField(CustomField field, Issue issue, String value) {
ApplicationUser user = null; // What do I put here instead of null?
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
issueInputParameters.addCustomFieldValue(field.getId(), value);
issueInputParameters.setSkipScreenCheck(true);
issueInputParameters.setRetainExistingValuesWhenParameterNotProvided(true, true);
UpdateValidationResult updateValidationResult = issueService.validateUpdate(user, issue.getId(), issueInputParameters);
//....
}