Hi,
I have recently created a post-function plugin that will update a custom field of a linked-issue (not the current issue) using OrderableField.updateValue. While the plugin works as expected, I notice that the changes I made to this issue is not even log in the history or activity. Is there a way I can enforce it to log the changes?
Thanks in advance!
Community moderators have prevented the ability to post new answers.
Apparently, it takes more than few lines of codes to make a change in custom field and to show up on hisotry.
To show in history (assuming you have make the change with field.updateValue and issue.setUPdated()
try { IssueUpdateBean issueUpdateBean = new IssueUpdateBean( issueToBe.getGenericValue(), internalIssue.getGenericValue(),EventType.ISSUE_UPDATED_ID, currUser); issueUpdateBean.setComment(changeHolder.getComment()); issueUpdateBean.setChangeItems(changeItemBeans); issueUpdateBean.setDispatchEvent(true); issueUpdateBean.setParams(EasyMap.build("eventsource", IssueEventSource.ACTION)); componentManager.getIssueUpdater().doUpdate(issueUpdateBean, true); } catch (JiraException e) { log.warn(e.getMessage()); }
You should create ChangeGroup, detailed explanation with examples you can find here: http://forums.atlassian.com/message.jspa?messageID=257372650
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From that post, I did use the ChangeIssueHolder as part of the updateValue function call.
field.updateValue(item, modIssue, newValue, new DefaultIssueChangeHolder());
Am I suppose to do set something than just create new instance of DefaultIssueChangeHolder?
Thanks again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also tried the changeholder and still not updated under history tab...i am running out of ideas.
IssueChangeHolder changeholder = new DefaultIssueChangeHolder();
changeholder.addChangeItem(new ChangeItemBean(ChangeItemBean.CUSTOM_FIELD, codStatus.getName(),newValue.getOldValue().toString(), newValue.getNewValue().toString()));
field.updateValue(item, modIssue, newValue, changeholder);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eva8
Were you able able to find solution for the above?
I am even facing the issue that history is not getting updated
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think if you update it like this:
Map actionParams = EasyMap.build("issue", issue.getGenericValue(), "issueObject", issue, "remoteUser", authenticationContext.getLoggedInUser(), "dispatchEvent", Boolean.FALSE); CoreFactory.getActionDispatcher().execute(ActionNames.ISSUE_UPDATE, actionParams);
it will put your history automatically
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.