Forums

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

Force issue creating - is it possible?

Michael I.
Contributor
February 13, 2012

Hi.

Is there a some API to force create an issue - without workflow conditions and validation?

I`m developing my plugin and I need to create issues without specifying values for some fields, marked as "required" by Field Configuration Scheme.

2 answers

1 accepted

2 votes
Answer accepted
Radek Kantor
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.
February 13, 2012

Hi,

you can create issue without some required values, but I think that information like project, issue type and summary are necessary.

Pseudo Code:

MutableIssue issue = IssueFactory.getIssue(); 
issue.setProjectId(10000L); 
issue.setIssueTypeId("5"); 
issue.setSummary("SUMMARY"); 
GenericValue issueGeneric = IssueManager.createIssue(user, issue);

Michael I.
Contributor
February 15, 2012

But there is not way to avoid a transition validation, right?

0 votes
Alexander Küken
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.
February 13, 2012

Hi Michael,

if I get you right, you want to automatically create issues, based on a transition?

Perhaps this fits your needs? https://plugins.atlassian.com/plugin/details/697735

Cheers,

Alexander

Michael I.
Contributor
February 13, 2012

Hi, Alexander.

No, this is not that I need. I`m developing my plugin and I need to create issues without specifying values for some fields, marked as "required" by Field Configuration Scheme.

Thanks for your answer anyway.

Best regards,

Michael.

Nic Brough -Adaptavist-
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.
February 13, 2012

I got as far as "this is quite difficult" as the code tries to enforce the mandatory fields at almost every turn.

However, I was able to "borrow" some code from the CSV importer - that can do it, with three caveats

  1. You still have to give it a summary
  2. Your users will have to be educated to fill in the fields before they can do anything else with the issue
  3. The code I "borrowed" was from before the CSV importer was pulled out into it's own plugin, so it's changed quite a lot at that point.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events