1. How can I add customfield value change to the one changegroup entry (with status change) as currently depicted field changes in a separate entry
2. In the change History i see "Anonymous made changes". Wy is that?
My plugin changes the value of one customfield on transition. I need to change is visible in the change history together with status changes in one changegroup entry. How this can be achieved?
At present, use the following code:
DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder(); final ModifiedValue modifiedValue = (ModifiedValue) modifiedFields.get(customField.getId()); //IssueChangeHolder changeHolder = new DefaultIssueChangeHolder(); customField.updateValue(fieldLayoutItem, issue, modifiedValue, issueChangeHolder); ChangeItemBean changeItemBean = new ChangeItemBean(ChangeItemBean.CUSTOM_FIELD, customField.getName(), null, (String) modifiedValue.getOldValue(), null, (String) modifiedValue.getNewValue() ); issueChangeHolder.addChangeItem(changeItemBean); ChangeLogUtils.createChangeGroup( null, issue, issue, issueChangeHolder.getChangeItems(), true ); issue.store(); try { ManagerFactory.getIndexManager().reIndex(issue); } catch (IndexException ex) { Logger.getLogger(MyPlugin.class.getName()).log(Level.SEVERE, null, ex); }
Community moderators have prevented the ability to post new answers.
Hi diana,
You have to add status entry as well as custom field value change in the same list of change item & create the change group of these change items.
You have to add status change value to your issueChangeHolder.
As in the method createChangeGroup , you are providing changeAuthor value as null. Therefore you can see "Anonymous made changes" in the change history.
I hope this will be useful to you!!
Regards,
Renu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.