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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


NullPointer exception for issueLinkManager.createIssueLink

I am getting a null pointer for  issueLinkManager.createIssueLink even though all the parameters of the API are not null. I am printing the parameters 1 by 1 and none of them is null. 

Here is my code: 

void createFeature(Issue issue, List<String> componentList){

def issueLinkManager = ComponentAccessor.issueLinkManager

def authenticationContext = ComponentAccessor.jiraAuthenticationContext

def issueFactory = ComponentAccessor.getIssueFactory()

def issueManager = ComponentAccessor.getIssueManager()

def userManager = ComponentAccessor.getUserUtil()

 def currentUserObj = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

long issueLinkType= 10070

long sequence =1

long newissueTypeID= 19

long myissueID= issue.getId()

MutableIssue newissue= ComponentAccessor.issueFactory.issue

//set values



newissue.setSummary("MOUNA CAMELIA")

newissue.setDescription("MOUNA CAMELIA")

newissue.reporter = issue.getReporter()

def newIssueCreated = issueManager.createIssueObject(currentUserObj, newissue)

long newIssueCreatedID= newIssueCreated.getId()

                 for(String component: componentList){

                     log.warn("MOUNA CAMELIA ===== myissueID ====="+ myissueID+" =====newissueTypeID ====="+newIssueCreated.getId()

                      +" =====issueLinkType ====="+issueLinkType

                     +" =====sequence ====="+ sequence +" =====authenticationContext.getLoggedInUser() ====="+authenticationContext.getLoggedInUser()


                     issueLinkManager.createIssueLink(myissueID, newIssueCreatedID, issueLinkType, sequence, authenticationContext.getLoggedInUser())



I printed the values of all the parameters in my log and none of them is null as you can see below: 

MOUNA CAMELIA ===== myissueID =====1521112 =====newissueTypeID =====1782817 =====issueLinkType =====10070 =====sequence =====1 =====authenticationContext.getLoggedInUser() =====mouh(JIRAUSER65000)


Yet, I am receiving a null pointer exception as you can see here, anyone knows what causes this problem?



0 answers

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events