Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

NPE in ADWEB

Stan Huang October 10, 2016

Hi Abhinav,

I'm still getting the error with v1.8.3, unfortunately.

  • I created a new, simple project (BUG) using the "Basic software development" template.
  • ADWEB is NOT configured for this project.
  • I created one issue in that project, using all default values except for the Summary, which I set to "Summary"
  • I added a workflow transition that loops from TO DO -> TO DO and associated that transition with a post function script:
package com.onresolve.jira.groovy.test.scriptfields.scripts

import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.transform.CompileStatic
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.bc.issue.IssueService.IssueResult
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.security.JiraAuthenticationContext
import com.atlassian.jira.user.ApplicationUser

@CompileStatic
private static void testBug(Issue issue, Logger log)
{
    log.debug 'Entered testBug'
    String issueKey = 'BUG-1'
    IssueService issueSvc = ComponentAccessor.getIssueService()
    IssueInputParameters issueInParams = issueSvc.newIssueInputParameters()
    ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
    log.debug 'Initialization complete'

    IssueService.IssueResult issueRslt = issueSvc.getIssue(user, issueKey)
    Issue theIssue = issueRslt.getIssue()
    log.debug issueKey + ' retrieved'
    issueInParams.setRetainExistingValuesWhenParameterNotProvided(true)
    issueInParams.setSkipScreenCheck(true)

    log.debug 'IssueInputParameters configured'
    IssueService.UpdateValidationResult updateValidRslt = issueSvc.validateUpdate(user, theIssue.getId(), issueInParams)

    log.debug 'validUpdate completed'
    if (!updateValidRslt.isValid())
        return

    log.debug 'IIP validated'
    return
}

log.setLevel(Level.DEBUG)


testBug(this.issue, this.log)
return

 

When executing this code, I get this error in the log:

2016-10-02 23:46:42,483 DEBUG [workflow.ScriptWorkflowFunction]: Entered testBug
2016-10-02 23:46:42,484 DEBUG [workflow.ScriptWorkflowFunction]: Initialization complete
2016-10-02 23:46:42,484 DEBUG [workflow.ScriptWorkflowFunction]: BUG-1 retrieved
2016-10-02 23:46:42,485 DEBUG [workflow.ScriptWorkflowFunction]: IssueInputParameters configured
2016-10-02 23:46:42,525 DEBUG [osgi.ActiveObjectsServiceFactory]: getService bundle [com.adweb.estimations.estimationUpdate]
2016-10-02 23:46:42,550 ERROR [workflow.ScriptWorkflowFunction]: *************************************************************************************
2016-10-02 23:46:42,553 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: BUG-1, actionId: 71, file: <inline script>
java.lang.NullPointerException
	at com.adweb.estimations.customFields.logWorkByRole.LogWorkByRoleCFType.validateFromParams(LogWorkByRoleCFType.java:206)
	at com.atlassian.jira.issue.fields.CustomFieldImpl.validateParams(CustomFieldImpl.java:741)
	at com.atlassian.jira.bc.issue.DefaultIssueService.validateAndPopulateParamsWithoutScreenCheck(DefaultIssueService.java:947)
	at com.atlassian.jira.bc.issue.DefaultIssueService.validateAndPopulateParams(DefaultIssueService.java:860)
	at com.atlassian.jira.bc.issue.DefaultIssueService.validateAndUpdateIssueFromFields(DefaultIssueService.java:660)
	at com.atlassian.jira.bc.issue.DefaultIssueService.validateUpdate(DefaultIssueService.java:278)
	at com.onresolve.jira.groovy.test.scriptfields.scripts.Script584.testBug(Script584.groovy:32)
	at com.onresolve.jira.groovy.test.scriptfields.scripts.Script584.run(Script584.groovy:44)

Additional observations:

  • If I disable the ADWEB add on (across the entire JIRA instance), the error does not occur, even though ADWEB is not even setup for this project.
  • If I re-enable ADWEB, the error occurs.
  • If I do not call setSkipScreenCheck(true) in the script above, this error does not happen.

I'm running:

  • Atlassian JIRA Project Management Software v7.1.1 
  • Adaptavist ScriptRunner for JIRA v4.3
  • ADWEB JIRA Role Based Estimations and Tracking v1.8.3

Let me know if I can provide any more information.

 

thanks.

stan.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Steven Hensgen October 11, 2016

Thanks for the detailed post Stan, from this I was able to replicate locally & have uploaded a new version of the plugin that should no longer throw this Null Pointer Error.

Thanks.

TAGS
AUG Leaders

Atlassian Community Events