Basically, I need a query to produce a list of issues where custom field 'X' is empty. But just before I query for these issues, I have some java code that edits custom field 'X'.
My problem is only after re-indexing does the query produce the desired resutls. I suspect that my java code is failing to update an index that later influences the query?
public static void editCustomField(Issue sourceIssue, String customField, String value){ CustomField cf = getCustomField(customField); IssueChangeHolder changeHolder = new DefaultIssueChangeHolder(); Object oldValue = issue.getCustomFieldValue(cf); ModifiedValue mod = new ModifiedValue(oldValue, value); cf.updateValue(null, issue, mod, changeHolder); }
Please help :(
Use IssueIndexManager to reindex it in code:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
glad it helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.