I have a problem in unflagging an issue using script runner groovy code.
It seems that somehow re-index is not happening.
Can anyone help ?
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def customFields = customFieldManager.getCustomFieldObjects();
IssueManager im = ComponentAccessor.getIssueManager();
def flaggedCF = customFields.findByName("Flagged");
MutableIssue flaggedIssue = im.getIssueObject("TEST-1");
boolean isIndex = ImportUtils.isIndexIssues();
IssueIndexingService IssueIndexingService = (IssueIndexingService) ComponentAccessor.getComponent(IssueIndexingService.class);
try this one
IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();
flaggedCF.updateValue(null, flaggedIssue, new ModifiedValue(flaggedIssue.getCustomFieldValue(flaggedCF), null), changeHolder)
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events