Hello.
Can you help me with the simple plugin development?
My plugin's code is here http://pastebin.com/uQtV1T79 - please look at my code.
When event fired, my plugin must set "sogl" user as assignee.
Output of the Tomcat's console is:
first event ("Issue created"):
++++++++++++++++++++++++++++++
1
---++++++++++++++++++++++++++++++
then, my event fired:
++++++++++++++++++++++++++++++
10003
List of users
sogl
END of List of users
++++++++++++++++++++++++++++++
3
---++++++++++++++++++++++++++++++
Issue updated
---++++++++++++++++++++++++++++++
But after this assignee isn't changed: in the issue's field "Assignee: admin" - the old assignee, but in "History" is the
testUser made changes - 9 minutes ago
Field Original Value New Value
Status Open [ 1 ] Согласование 0 [ 10003 ]
testUser made changes - 9 minutes ago
Assignee admin [ admin ] sogl [ sogl ]
Screenshot is attached.
My be after
IssueService issueService = ComponentAccessor.getIssueService(); AssignValidationResult avr = issueService.validateAssign(UserUtils.getUser("testUser"), issue.getId(), uName); if (avr.isValid()) { IssueResult updateResult = issueService.assign(UserUtils.getUser("testUser"), avr);
*********
I must re-index issue? How to fix this problem?
P.S.
When fired my event, I have receive e-mail:
testUser assigned TEES-27 to sogl
dsfdsfsdf
Change By: testUser (16/июл/13 4:21 PM)
Assignee: admin sogl
Community moderators have prevented the ability to post new answers.
You have to do cast issue from issueEvent. IssueService have other instance issue. For example, this example works in 5.x and I suppose in 6.x too:
Issue issue = issueEvent.getIssue(); if (issue instanceof MutableIssue) { MutableIssue mutableIssue =(MutableIssue)issueEvent.getIssue(); mutableIssue.setAssignee(yourUser); ComponentAccessor.getIssueManager().updateIssue(userWhoDoUpdate, mutableIssue, EventDispatchOption.DO_NOT_DISPATCH, false); }
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.