In Java, editing a custom field fails to update indexes?

ryan McCullough March 19, 2012

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 :(

1 answer

1 accepted

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2012
ryan McCullough March 19, 2012

that was perfect, thank you sir!

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2012

glad it helped!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events