Hello,
Is there any way to impersonate the method 'updateValue' from a CustomField? Checked this one, but can't see anything related to ApplicationUser. Maybe it's possible from a fieldManager? I can't figre it how.
Any suggestion?
Got it:
ApplicationUser userDoingAction = ComponentAccessor.getUserManager().getUserByKey(<user_key>);
def issueService = ComponentAccessor.getIssueService()
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.addCustomFieldValue(<customField_id>, <nullable_value>)
def update = issueService.validateUpdate(userDoingAction, issueLinked.id, issueInputParameters)
if (update.isValid()) {
issueService.update(userDoingAction, update)
} else {
log.warn("${update.getErrorCollection().getErrors()}")
}
There is a bug, already reported to ScriptRunner: you can't impersonate changes at 'Epic Link' custom field.
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.