Details
-
Bug
-
Resolution: Fixed
-
Highest
-
None
Description
This has been found by debugging this support issue: https://support.atlassian.com/browse/JST-60124
When there is a post function to clear an assignee in a workflow transition we get the error: "Unable to purge contents of field - assignee - Assignee"
In the logs we get this exception:
400000005151195714bf5cfc 2013-03-25 20:43:09,342 TP-Processor11 ERROR sysadmin 1243x1909x1 1wub7ek 59.167.133.100,131.103.26.225 /secure/CommentAssignIssue.jspa [jsu.workflow.function.ClearFieldValuePostFunction] Unable to purge contents of field - assignee - Assignee @400000005151195714bf64cc java.lang.NullPointerException @400000005151195714bf68b4 at com.googlecode.jsu.util.WorkflowUtils.convertApplicationUserToCrowdEmbeddedUser(WorkflowUtils.java:887) @400000005151195714bf68b4 at com.googlecode.jsu.util.WorkflowUtils.setFieldValue(WorkflowUtils.java:654) @400000005151195714bf9794 at com.googlecode.jsu.util.WorkflowUtils.setFieldValue(WorkflowUtils.java:926) @400000005151195714bf9b7c at com.googlecode.jsu.workflow.function.ClearFieldValuePostFunction.executeFunction(ClearFieldValuePostFunction.java:58) @400000005151195714bf9f64 at com.googlecode.jsu.workflow.function.AbstractPreserveChangesPostFunction.execute(AbstractPreserveChangesPostFunction.java:59) @400000005151195714bfab1c at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1050) @400000005151195714bfab1c at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1446) @400000005151195714bfaf04 at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:564) @400000005151195714bfbea4 at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:955) @400000005151195714bfc28c at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:910) @400000005151195714bfc674 at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:451) @400000005151195714bfca5c at com.atlassian.jira.web.action.issue.CommentAssignIssue.doExecute(CommentAssignIssue.java:196) ...
Instance Bug Reproduced on
https://clone-pocketgems.atlassian.net/
Talk to Support about getting sysadmin password
Culprit Files
- Culprit class WorfkflowUtils: https://github.com/atlassian/jira-suite-utilities/blob/b1eb31e7bd96c93270e82e842a1d1a74aa5de0ea/src/main/java/com/googlecode/jsu/util/WorkflowUtils.java
- The exception is being caught and rethrown in this file: https://github.com/atlassian/jira-suite-utilities/blob/b1eb31e7bd96c93270e82e842a1d1a74aa5de0ea/src/main/java/com/googlecode/jsu/workflow/function/ClearFieldValuePostFunction.java
- The commit that has caused this bug: https://github.com/atlassian/jira-suite-utilities/commit/b1eb31e7bd96c93270e82e842a1d1a74aa5de0ea#L1L866
Cause of Bug
In function ClearFieldValuePostFunction.executeFunction we call the workflowUtils.setFieldValue function with parameter 'value' = null as seen on line 58.
On line 655 of WorkflowUtil we call User user = convertApplicationUserToCrowdEmbeddedUser(convertValueToUser(value));
convertValueToUser(null) returns null so null is passed to convertApplicationUserToCrowdEmbeddedUser found on line 886. here the parameter calles .getUsername but as it is null a null pointer exception is made. This change was added in the commit provided above.
Possible solution
Null pointer check in convertApplicationUserToCrowdEmbeddedUser function.
Workaround
Instead of using the Clear Post Function the Update Issue Field Function should be used instead where the field value is 'Unassigned', see attached screenshot.
Attachments
Issue Links
- is related to
-
JRACLOUD-66365 UpdateIssueFieldFunction workflow post function is broken
- Closed
- mentioned in
-
Wiki Page Loading...
- relates to
-
JRADEV-19968 Loading...