Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Null pointer execption error while fetching plan using PlanManager.


Can someone please provide a hint as to what could be going wrong, I am using atlassian-sdk to develop a plugin which displays a new tab when a job containing a specific task (RobotTask) is clicked..

I am getting Null pointer exception error for a very simple thing that I am doing which is fetching the Plan by using the planKey and PlanManager.


64: Plan plan = planManager.getPlanByKey(planKey).

I have a valid plan key which is "TPRO1-TPLAN1-JOB1". Even when I try to use "TPRO1-TPLAN1" as the plan key, I still get the exception...


My code looks like this

public boolean shouldDisplay(Map<String, Object> context) {
    	PlanKey planKey = PlanKeys.getPlanKey((String) context.get("planKey"));
        Plan plan = planManager.getPlanByKey(planKey);
        List<TaskDefinition> tasks = plan.getBuildDefinition().getTaskDefinitions();
        for(TaskDefinition task : tasks) {
            if(task.getPluginKey().equals(RobotTask.KEY) ) {
                return true;

        return false;


Below is the stack strace

[INFO] [talledLocalContainer] 2018-05-10 12:14:39,083 ERROR [http-nio-6990-exec-12] [DefaultWebInterfaceManager] Could not evaluate condition 'isode.robot.RobotReportViewCondition@72267783' for descriptor: isode.robotplugin:KeyWebItemRobotReportTab (null)
[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer]     at isode.robot.RobotReportViewCondition.shouldDisplay(
[INFO] [talledLocalContainer]     at com.atlassian.plugin.web.DefaultWebInterfaceManager.filterFragmentsByCondition(
[INFO] [talledLocalContainer]     at com.atlassian.plugin.web.DefaultWebInterfaceManager.getDisplayableItems(
[INFO] [talledLocalContainer]     at com.atlassian.bamboo.ww2.BambooActionSupport.getWebItemsForSection(
[INFO] [talledLocalContainer]     at sun.reflect.GeneratedMethodAccessor1656.invoke(Unknown Source)
[INFO] [talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
[INFO] [talledLocalContainer]     at java.lang.reflect.Method.invoke(
[INFO] [talledLocalContainer]     at freemarker.ext.beans.BeansWrapper.invokeMethod(
[INFO] [talledLocalContainer]     at freemarker.ext.beans.SimpleMethodModel.exec(
[INFO] [talledLocalContainer]     at freemarker.core.MethodCall._eval(
[INFO] [talledLocalContainer]     at freemarker.core.Expression.eval(
[INFO] [talledLocalContainer]     at freemarker.core.Assignment.accept(
[INFO] [talledLocalContainer]     at freemarker.core.Environment.visit(
[INFO] [talledLocalContainer]     at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(
[INFO] [talledLocalContainer]     at freemarker.core.IteratorBlock$IterationContext.accept(
[INFO] [talledLocalContainer]     at freemarker.core.Environment.visitIteratorBlock(
[INFO] [talledLocalContainer]     at freemarker.core.IteratorBlock.acceptWithResult(
[INFO] [talledLocalContainer]     at freemarker.core.IteratorBlock.accept(
[INFO] [talledLocalContainer]     at freemarker.core.Environment.visit(
[INFO] [talledLocalContainer]     at freemarker.core.Environment.invoke(
[INFO] [talledLocalContainer]     at freemarker.core.UnifiedCall.accept(
[INFO] [talledLocalContainer]     at freemarker.core.Environment.visit(
[INFO] [talledLocalContainer]     at freemarker.core.Environment.visit(
[INFO] [talledLocalContainer]     at freemarker.core.Environment.invoke(

1 comment

I found what the problem was, I did not have the constructor to do the initialization.

Below solved it.

public RobotReportViewCondition(final PlanManager planManager){
this.planManager = planManager;


Log in or Sign up to comment
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

951 views 3 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you