Forums

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

not able to create issue type using plugin

manoharv August 21, 2017

I am very new to plugin development , getting null pointer exception when i am trying to create issue type using plugin 

following is my servelet code 

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.atlassian.jira.config.IssueTypeManager;
import com.atlassian.jira.issue.issuetype.IssueType;

public class CreateIssueTypeManagerImpl extends HttpServlet {

private IssueTypeManager issueTypeManager;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/plain");
PrintWriter out = resp.getWriter();

out.println("Creating Issue...");
out.flush();

IssueType customIssue = issueTypeManager.createIssueType("TestCase",
"Test case issue type", (long) 10000);

if (customIssue != null) {
out.println("Updating " + customIssue.getId());

}

out.println("issue is not created");
}

}

 

 

 

 

plguin.xml entry 

 

<servlet name="Issue Servlet" key="issueManager" class="com.testcase.plugin.impl.CreateIssueTypeManagerImpl">
<description>Creates,Edits Issues</description>
<url-pattern>/issueManager</url-pattern>
</servlet>

error log 

 

[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer] at com.testcase.plugin.impl.CreateIssueTypeManagerImpl.doGet(CreateIssueTypeManagerImpl.java:26)

 

1 answer

0 votes
Alex Christensen
Community Champion
August 21, 2017

Hi, Manohar - I don't have an answer for you, but you might have better luck getting an answer in Atlassian's Developer Community, which is a separate site from this Community site.

https://developer.atlassian.com/community/

Sorry I couldn't be of more help!

manoharv August 21, 2017 edited

Thanks Alex Christensen for quick replay 

 

I created issue in developer community !

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira product discovery, jpd premium, product management, idea management, product discovery, jira premium, product planning, atlassian community, product development, roadmap planning, product prioritization, feature management

Introducing Jira Product Discovery Premium ✨

Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.

Learn more
AUG Leaders

Atlassian Community Events