Missed Team ’24? Catch up on announcements here.

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

update Function not working

David Lemon May 26, 2013

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

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
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.
May 26, 2013

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".

David Lemon May 26, 2013

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??

0 votes
Mizan
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.
May 26, 2013

Is this a post function ? try adding mutableIssue.store() after you set value .

David Lemon May 26, 2013

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 .

TAGS
AUG Leaders

Atlassian Community Events