I have a strange problem where I update the Business Value in an issue, then go to the Agile board view and the value is still the old value. Note that I have selected Business Value as the Estimate so I can see that value in the roundish grey areas on each backlog item.
If i go back to the issue again I can confirm that the value is in fact changed to the new value. After about 1-2 minutes the value suddenly appears even in the Agile board backlog view. Why this delay? Can I do something about it? Since I use this value to help me sort the backlog it is quite annoying with this delay - I would expect it to be instant.
Thanks for any help
I'm using the latest version of JIRA and JIRA Agile with FishEye as plugin. The only plug-in I have is Script Runner and I use that to calculate the Business Value. So if I change due date or some other fields the Business Value instantly re-calculates and I can see the new value. However it doesn't seem to propagate to the Agile Board view instantly which is strange.
I have now created a listener plugin using Atlassians tutorials for developers. That seems to work and the code looks like this:
package com.example.tutorial.plugins;
import com.atlassian.event.api.EventListener;
import com.atlassian.event.api.EventPublisher;
import com.atlassian.jira.event.issue.IssueEvent;
import com.atlassian.jira.event.type.EventType;
import com.atlassian.jira.issue.Issue;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.index.IndexException;
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder;
import com.atlassian.jira.issue.util.IssueChangeHolder;
import com.atlassian.jira.util.ImportUtils;
import com.atlassian.jira.issue.index.IssueIndexManager;
/**
* Simple JIRA listener using the atlassian-event library and demonstrating
* plugin lifecycle integration.
*/
public class IssueCreatedResolvedListener implements InitializingBean, DisposableBean {
private final EventPublisher eventPublisher;
/**
* Constructor.
* @parameventPublisher injected {@codeEventPublisher} implementation.
*/
public IssueCreatedResolvedListener(EventPublisher eventPublisher) {
this.eventPublisher = eventPublisher;
}
/**
* Called when the plugin has been enabled.
* @throws Exception
*/
@Override
public void afterPropertiesSet() throws Exception {
// register ourselves with the EventPublisher
eventPublisher.register(this);
}
/**
* Called when the plugin is being disabled or removed.
* @throws Exception
*/
@Override
public void destroy() throws Exception {
// unregister ourselves with the EventPublisher
eventPublisher.unregister(this);
}
private void reIndexIssue(Issue issue){
boolean wasIndexing = ImportUtils.isIndexIssues();
ImportUtils.setIndexIssues(true);
try {
ComponentAccessor.getIssueIndexManager().reIndex(issue);
} catch (IndexException e) {
System.out.println("Reindex error!!");
}finally{
ImportUtils.setIndexIssues(wasIndexing);
}
}
/**
* Receives any {@codeIssueEvent}s sent by JIRA.
* @paramissueEvent the IssueEvent passed to us
*/
@EventListener
public void onIssueEvent(IssueEvent issueEvent) {
//Long eventTypeId = issueEvent.getEventTypeId();
Issue issue = issueEvent.getIssue();
Issue parent = issue.getParentObject();
// if an event is triggered, re-index
//if (eventTypeId.equals(EventType.ISSUE_UPDATED_ID)) {
reIndexIssue(issue);
if (parent != null) {
reIndexIssue(parent);
}
//}
}
}
I was wrong, it has nothing to do with time. But if I drag and drop the issue and press F5 it does update the value. So re-indexing seems to be the thing. See my question to one issue on your site if the fast-track issue could be updated so I can select "no transition" or "loop back to same transition". That way I could add the re-indexing code using that listener.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does it appear in a standard query after the same amount of time, or immediately?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you have any tips on how to script update the index?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No I don't script update the index since I don't know how to do that? I also got the comment recently from Jamie from Script Runner that i should not try to update the issue from a scripted field "as you won't be able to reindex the issue without getting in to an infinite loop" he sais? I don't seem to have that problem though. He tells me to use a listener instead.
Any comments to that? How can I set the Business Value using a listener?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe its due to the index since it use that in the Agile board. And when you check inside a issue, it get the value from the database. Do you script update the index each time ?
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.