Forums

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

Static type checking- The variable [jiraHelper] /issue is undeclared- script editor

Mouna Hammoudi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2022

I am using a condition in my script in the REST endpoint and I am receiving the following errors. JiraHelper and Issue are not recognized.

enter image description here

Anyone knows what the problem is and what needs to be fixed?

Here is the code:

 package CreateMultipleSubtasks



import org.apache.log4j.Logger
 import com.atlassian.jira.plugin.webfragment.model.JiraHelper
 import com.atlassian.jira.component.ComponentAccessor




def log1 = Logger.getLogger("atlassian-jira.log")

log1.warn("MOUNA BEFORE")
Configuration_CreateMultipleSubtasks conf = new Configuration_CreateMultipleSubtasks()
def subTaskCreatorHashMap= conf.getSubTaskCreatorHashMap()


String projectKey = subTaskCreatorHashMap["projectKey"];
String issueTypeName = subTaskCreatorHashMap["issueTypeName"];

log.warn("MOUNA PROJECT KEY "+ projectKey+" issuetypename "+issueTypeName)
def val=jiraHelper.project?.key==projectKey  &&  issue.issueType.name==issueTypeName

return val

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events