You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I found this method :
ComponentAccessor.getIssueManager().createIssueObject(user, issue);
whereas issue is the issue to be created.
So I have problems to create this issue, because Issue and MutableIssue are both interfaces.
You could do
MutableIssue issueNew = new MutableIssue{...} // implement about 100 Methods :(
The other way would be with a map .
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
Map<String,Object> map = new HashMap<>();
map.put("Summary","My Summary");
// and all the other fields..
Issue createdIssue = ComponentAccessor.getIssueManager().createIssueObject(user,map);
I am not happy with all these approaches. For example I do not exactly know what key to put in the map. Is it the same as the label you see next to the fields in the ticket ?
Hello @Albert Cameron
you can try with issueFactory
import com.atlassian.jira.component.ComponentAccessor
def issueFactory = ComponentAccessor.getIssueFactory()
def issueManager = ComponentAccessor.getIssueManager()
def userManager = ComponentAccessor.getUserUtil()
def currentUserObj = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
MutableIssue newissue
newissue = issueFactory.getIssue()
//set values
newissue.setProjectObject(issue.projectObject)
newissue.setIssueTypeId(issue.getIssueTypeId())
newissue.setSummary(issue.summary)
newissue.setDescription(issue.getDescription())
newissue.reporter = issue.getReporter()
def newIssueCreated = issueManager.createIssueObject(currentUserObj, newissue)
I hope it helps.
Best regards.
IssueInputParameters issueIP = build.getIssueIP();
final IssueService.CreateValidationResult createValidationResult = issueService.validateCreate(user, issueIP);
Yeah thanks.
There is also a class IssueInputParameters. Which also is usefull for setting CustomFields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, there is.
After creating the issue, this new issue is a "normal mutable Issue".
So you can use the typical way to update it.
For example this.
https://library.adaptavist.com/entity/update-the-value-of-a-custom-field-using-a-listener
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.