Getting package import error while creating due-date-indicator plugin?

Hi Guys,

I am attempting to build a due-date-indicator plugin. I have imported my code into the eclipse. I am getting errors in the package import statement in the .java file. In the .java file I am getting error in the "package com.atlassian.jira.user;" statement. In the eclipse it is showing error hint as "The declared package "com.atlassian.jira.user" does not match the expected package "com.example.plugins.tutorial". By keeping this error in the file I run my code using atlas command. I got the error in the Jira view issue page "Error rendering 'com.example.plugins.tutorial.duedate:due-date-indicator'. Please contact your JIRA administrators". How to resolve this error?

My .java file:

package com.example.plugins.tutorial;
package com.atlassian.jira.user;
import com.atlassian.jira.user.ApplicationUser;

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.plugin.webfragment.contextproviders.AbstractJiraContextProvider;
import com.atlassian.jira.plugin.webfragment.model.JiraHelper;

import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;
import java.lang.*;
public class DueDateIndicator extends AbstractJiraContextProvider
private static final int MILLIS_IN_DAY = 24 * 60 * 60 * 1000;

public Map getContextMap(ApplicationUser applicationUser, JiraHelper jiraHelper) {
Map contextMap = new HashMap();
Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
Timestamp dueDate = currentIssue.getDueDate();
if (dueDate != null)
int currentTimeInDays = (int) (System.currentTimeMillis() / MILLIS_IN_DAY);
int dueDateTimeInDays = (int) (dueDate.getTime() / MILLIS_IN_DAY);

int daysAwayFromDueDateCalc = dueDateTimeInDays - currentTimeInDays + 1;
contextMap.put("daysAwayFromDueDate", daysAwayFromDueDateCalc);
return contextMap;

//public Map getContextMap(ApplicationUser arg0, JiraHelper arg1) {
//TODO Auto-generated method stub
// return null;


Thanks in advance

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,782 views 18 21
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you