Issue Summary
While trying to submit a new issue using the mail handler (Email Channel) or update an Assets custom field via Automation or perform a bulk edit, this action will fail with NullPointerException in case the Assets field includes the request's issue type in its context (or if the Assets field has a global context).
Steps to Reproduce
- Create a JSM project that utilizes Assets custom fields.
- Create a new request type. Optionally you could add the Assets field to the creation form.
- Make sure that the Assets field context includes the issue type of the JSM request.
- Configure the Email Channel to create new issues of the configured request type with the help of email messages.
- Try to create a new issue by sending an email to the email channel's address. This action will fail with an exception.
- At the same time, the creation of the same issue through the portal or Jira UI will be completed successfully.
Expected Results
The issue will be successfully created
Actual Results
- While trying to create a new issue from email, the mail handler will fail to do this and the following exception will be thrown at atlassian-jira.log;
2024-06-27 09:52:42,776+0000 Caesium-1-1 ERROR admin [c.a.p.i.util.runner.AuthenticationContextUtilImpl] Unexpected error while running action as user 'admin' java.lang.NullPointerException: Cannot invoke "javax.servlet.http.HttpServletRequest.getParameterMap()" because the return value of "com.atlassian.jira.web.ExecutingHttpRequest.get()" is null at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getIssueIdFromRequestContext(DefaultObjectCustomField.java:664) at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getIssueIdFromParamsOrContext(DefaultObjectCustomField.java:660) at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.validateFromParams(DefaultObjectCustomField.java:584) at com.atlassian.jira.issue.fields.ImmutableCustomField.validateParams(ImmutableCustomField.java:713) at com.atlassian.servicedesk.internal.feature.customer.request.data.validation.VisibleFieldValidator.performFieldValidationInJira(VisibleFieldValidator.java:112) ...
- A similar exception might be also triggered while trying to set the value for this Asset field using Automation for Jira:
2024-06-26 07:31:21,448+0200 automation-rule-executor:thread-3 ERROR <a4j_user> [c.c.a.r.j.action.edit.EditIssueActionExecutor] Unexpected error editing issue: java.lang.NullPointerException: Cannot invoke "javax.servlet.http.HttpServletRequest.getParameterMap()" because the return value of "com.atlassian.jira.web.ExecutingHttpRequest.get()" is null at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getStringListMapFromRequestContext(DefaultObjectCustomField.java:837) at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getcustomFieldScopedIql(DefaultObjectCustomField.java:848) at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.isValidObjectBeanScope(DefaultObjectCustomField.java:928)
- A similar Error is also observed when creating issues via "External System import" where the "csv file" to be imported has "Asset Custom Field"
2024-07-22T19:34:48,384 INFO - Importing issue: [externalId='autoid-8287103338540152504', summary='External System Import Test'] 2024-07-22T19:34:48,408 WARN - Cannot add value [ [CFB-34306] ] to CustomField Asset Object CF in Issue with summary 'External System Import Test'. Exception Message: null java.lang.NullPointerException: null at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getIssueIdFromRequestContext(DefaultObjectCustomField.java:664) ~[?:?] at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getIssueIdFromParamsOrContext(DefaultObjectCustomField.java:660) ~[?:?] at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getValueFromCustomFieldParams(DefaultObjectCustomField.java:719) ~[?:?] at com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField.getValueFromCustomFieldParams(DefaultObjectCustomField.java:98) ~[?:?]
Note about this bug
Due to this bug, Automation Rules involving Assets might fail to complete due to the same error, as shown in the Rule Audit Logs:
Workaround
So far, the only workaround that prevents the problem would be limiting the context of Assets to exclude the request's issue types from its scope. Other workarounds will be added here when available
Form Name |
---|