Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot invoke method newInfoQueryBuilder() on null object

Kleber Fonseca
Contributor
December 5, 2024

Hi

I´m using a script in post-function to set a value to a customfield ( "Set Field Value Post Function - JMWE app .9.1.0 and Jira DataCenter v.9.12.7

 

No error occours at Script Runner Console, but running the transaction, I have this message error : "Cannot invoke method newInfoQueryBuilder() on null object" to this code:

 

Note : This works with Jira 8. 

Note2: "SlaInformationService srv = ComponentAccessor.getOSGiComponentInstanceOfType(SlaInformationService)" also worked with Jira 8 but now it says that "Unable to resolve component: interface com.atlassian.servicedesk.api.sla.info.SlaInformationService" BUT not in ScriptRunner Console. 

Bug in JMWE ???

 

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.servicedesk.api.sla.info.SlaInformationService

import com.atlassian.servicedesk.api.sla.info.SlaInformationQuery

import com.atlassian.servicedesk.api.util.paging.PagedResponse

import com.atlassian.servicedesk.api.sla.info.SlaInformation

import com.atlassian.jira.bc.issue.search.SearchService

import com.atlassian.jira.web.bean.PagerFilter

import com.atlassian.servicedesk.api.util.paging.SimplePagedRequest

import com.atlassian.servicedesk.api.util.paging.PagedRequest

import com.onresolve.scriptrunner.runner.customisers.WithPlugin

import com.onresolve.scriptrunner.runner.customisers.PluginModule

@WithPlugin("com.atlassian.servicedesk")

@PluginModule SlaInformationService srv

//SlaInformationService srv = ComponentAccessor.getOSGiComponentInstanceOfType(SlaInformationService)

long idDummy = 1399021//issue.id

PagedRequest pagedRequest

SlaInformationQuery slaQuery

def slaInfo

PagedResponse pagedResponse

SlaInformation[] SLAs = null

pagedRequest = new SimplePagedRequest( 0, 5 )

slaQuery = srv.newInfoQueryBuilder().issue( idDummy ).pagedRequest( pagedRequest ).build()

 

 

 

 

 

 

1 answer

0 votes
Kseniia Trushnikova
Community Champion
January 12, 2025

Hi @Kleber Fonseca,

The JMWE 9.1.1 version includes a bug fix for the 'Set Issue Fields' post function. Do you have this error in the latest version of JMWE?

Kleber Fonseca
Contributor
January 12, 2025

Hi @Kseniia Trushnikova 

yes, I have the same error in the JMWE 9.1.1

Suggest an answer

Log in or Sign up to answer