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

How to create new Issue in java

S R June 9, 2013

I m using ComponentAccessor.getIssueFactory().getIssue()

But it returns null.

How to implement this functionality?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Alejandro Conde Carrillo
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.
June 9, 2013

Creating and Editing an Issue :)

It seems like the correct method. Does getIssueFactory() returns null? Is it correctly instantiated?

0 votes
S R June 9, 2013

Then i'm doing

issueObject.setProjectId(new Long(10000));

issueObject.setIssueTypeId("Bug");

issueObject.setSummary("summary");

ComponentAccessor.getIssueManager().createIssueObject(

ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), issueObject);

And returns com.atlassian.jira.exception.CreateException: com.atlassian.jira.workflow.WorkflowException

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 9, 2013

Um, you can't "get" an issue until it exists, so I'm not sure where your code came from.

Anyway, last time I wrote something to create an issue from scratch, I based it on the code from https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+JIRA+Issue+CRUD+and+Search - there may be better pages or tutorials, but I quite like that one because it covers create, edit and find in one place.

lmilleso February 27, 2015

According to the documentation, getIssue() is supposed to create an issue.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 27, 2015

Um, not in the document I posted. What are you reading? Also, in nearly two years, stuff changes. Why are you posting here? What are you actually stuck on?

lmilleso February 27, 2015

We are on 5.1 so I thought it would still apply.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 27, 2015

Ah, yes, but it doesn't quite create a new issue, just an object to represent one.

TAGS
AUG Leaders

Atlassian Community Events