Error assigning value to a custom field in IssueInputParameters class

I am using addCustomFieldValue method to assign value to my custom field. However, I am facing issues assigning it.

This is my code :
IssueInputParameters parameters = issueService.newIssueInputParameters(transientVars);
IssueService.UpdateValidationResult result = issueService.validateUpdate(user, issue.getId(), parameters);
issueService.update(user, result);
PFA the screenshot for the same!Thanks.

After using IssueService.validateUpdate , I am getting the following error :

Error Messages: [You can not update a null issue.]