Hello
Many examples here refer to custom field modification sequence as
def changeHolder = new DefaultIssueChangeHolder()
customField.updateValue(null, issue,
new ModifiedValue(issue.getCustomFieldValue(customField), newValue), changeHolder)
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
Then JIRA issue lacks a "History" block to track such "change items". I guess "change group" has been created without any "history metadata".
So I try to move to UpdateIssueRequest builder API:
def historyParticipant = HistoryMetadataParticipant.builder(user.getUsername(), "user?").build()
def historyMetadata = HistoryMetadata.builder("type?")
.actor(historyParticipant).activityDescription("Migration labels").build()
def updateIssueRequest = UpdateIssueRequest.builder().historyMetadata(historyMetadata)
.eventDispatchOption(EventDispatchOption.DO_NOT_DISPATCH).sendMail(false).build()
issueManager.updateIssue(user, issue, updateIssueRequest)
But I have found no effective example in API how to properly:
- build HistoryMetadataParticipant which requires an ID and a Type - what should they be?
- build HistoryMetadata which requires also a Type - what are possible values?
And of course, I fear to break my JIRA instance after any trial with stupid types or ids...
May you help me to find out the right way to do it?
Thank you in advance for your help
Yves
According to https://community.atlassian.com/t5/Agile-articles/Three-ways-to-update-an-issue-in-Jira-Java-Api/ba-p/736585
CustomField.updateValue will not create change history. So I had to switch to IssueService.update method.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.