Hi
I've written a listener plugin that amongst other things, automatically updates the worklog based on the user pressing start progress & stop progress.
The worklog updates at the bottom of the screen, but the logged work shown on the right of the screen (plus the remaining estimate) does not update.
it is calling createAndAutoAdjustRemainingEstimate
Is there anything I've missed? It works fine except it doesnt appear to update the estimate
ComponentManager cm = ComponentManager.getInstance(); IssueIndexManager indexManager = cm.getIndexManager(); JiraAuthenticationContext jac = cm.getJiraAuthenticationContext(); User user = jac.getUser(); //JiraServiceContext jsc = new JiraWebActionSupport().getJiraServiceContext(); JiraServiceContext jsc = new JiraServiceContextImpl(user); WorklogService wls = (WorklogService) ComponentManager.getComponentInstanceOfType(WorklogService.class); JiraServiceContext context = new JiraServiceContextImpl( user ); String timeSpent = dur + "m"; startFieldText.getCustomFieldType().updateValue(startFieldText,issueEvent.getIssue(),timeSpent); WorklogNewEstimateInputParameters params = createParams( issue, timeSpent, stDate ); WorklogResult result = wls.validateCreate( context, params ); wls.createAndAutoAdjustRemainingEstimate( context, result, true ); try { indexManager.reIndex(issueGV2); } catch (IndexException e) { throw new WorkflowException(e); } private WorklogNewEstimateInputParameters createParams( MutableIssue issue, String timeSpent, Date StartDate ) { return WorklogInputParametersImpl .issue( issue ) .startDate( StartDate ) .timeSpent( timeSpent ) .comment( "Autologged " + timeSpent + "." ) .buildNewEstimate(); }
Community moderators have prevented the ability to post new answers.
Is this working for you now? I am in need of the same thing.
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.