Project newProject = ComponentAccessor.getProjectManager().getProjectObjByKey("PA"); MutableIssue mutableIssue = (MutableIssue) event.getIssue(); mutableIssue.setProjectObject(newProject); mutableIssue.setProjectId(newProject.getId()); Long nextId = ComponentAccessor.getProjectManager().getNextId(newProject); mutableIssue.setKey(newProject.getKey()+"-"+nextId); mutableIssue.setSummary(mutableIssue.getSummary()+" "+nextId); log.warn("new issue project key: "+mutableIssue.getKey()); Issue newIssue = null; try{ newIssue = ComponentAccessor.getIssueManager().updateIssue(event.getUser(),mutableIssue, EventDispatchOption.DO_NOT_DISPATCH,false); } catch (Exception e) { e.printStackTrace(); } log.warn("Updated");
working:
setSummary and rest others. even the log trace is showing the change. but not reflecting on the db and the UI.
not working:
setKey()
SetProjectId()
SetProjectObject()
please tell me if any problem in my code?
log trace:
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] Issue Updated
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] jira.system.event.type
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] This is the 'issue updated' event.
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] 2
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] **************************************
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] event Issue values
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] ST-100-15203-attachment test 93
2013-05-27 14:24:08,101 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] event Project :project: values
2013-05-27 14:24:08,102 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] ST-Stalwarts-10202
2013-05-27 14:24:08,102 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] event Project :projectObject:
2013-05-27 14:24:08,102 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] ST-Stalwarts-10202
2013-05-27 14:24:08,102 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] ****************************
2013-05-27 14:24:08,102 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] New Project
2013-05-27 14:24:08,144 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] new issue project key: PA-94
2013-05-27 14:24:08,186 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] Updated
2013-05-27 14:24:08,186 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] New Issue values
2013-05-27 14:24:08,186 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] PA-94-15203-attachment test 93 94
2013-05-27 14:24:08,186 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] event Project :project: values
2013-05-27 14:24:08,186 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] PA-Pacers-10200
2013-05-27 14:24:08,186 http-2990-4 WARN sohil 864x6779x1 83ixnf fe80:0:0:0:acd2:1ffb:4a90:29b2 /secure/IssueAction.jspa [jira.plugin.DbUpdateListenerBugMover.class] new issue issue keyPA-94
Community moderators have prevented the ability to post new answers.
You are trying to "edit" an issue, but you need to "move" it. The "edit" process will not let you change project or issue key, because that's a "move".
hello Nic Brough Moving means creating new issue object and assigning it with the old values and deleting the old issue????
is this what you want to say??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this a post function ? try adding mutableIssue.store() after you set value .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello mizan
this is a jira listener plugin. and in jira 5.2.11 mutableIssue.store() is depricated.
the update should do all the formalities.
and my summary is getting updated means something is changing .
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.