What's the best method of storing an update to a JIRA customfield?
I'm using the following
customFieldName = "SRL Responsible";
customField = customFieldManager.getCustomFieldObjectByName(customFieldName);
modifiedValue = new ModifiedValue(parentIssue.getCustomFieldValue(customField), issueObject.getCustomFieldValue(customField));
customField.updateValue(null, parentIssue, modifiedValue, new DefaultIssueChangeHolder());
boolean imp = ImportUtils.isIndexIssues();
ImportUtils.setIndexIssues(true);
parentIssue.store();
ComponentManager.getInstance().getIndexManager().reIndex(parentIssue.getGenericValue());
ImportUtils.setIndexIssues(imp);
However this doesn't seem to apply the update immediately, and so when I try to read from this "updated" field in the same plugin I get the old value of the field returned.
Community moderators have prevented the ability to post new answers.
This should update immediately. Probably you are trying with the old issueObject when you read it again? Try to get the updated issueObject using issueManager and see if it helps!
PS: you don't even need to do issue.store()!
Perfect your idea worked like a charm
I added the following line after all the update commands
parentIssue = ComponentManager.getInstance().getIssueManager().getIssueObject(issueId);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad it worked.. I have come across this before ;)
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.