Hi
we have script that set the original estimate to '0' under certain conditions.
We also like this to reflect it in the history and in the agile board (burndown)
for some reason it seems that the remaining estimation update event affect the original estimation as well and we see in the issue history that the original estimate was set to '0' as well (although the actual original estimate is not zero) and it messed up our burndown chart
any idea how can we fix this?
we use the following script:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.issue.IssueEvent import com.atlassian.jira.event.type.EventDispatchOption; import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.security.JiraAuthenticationContext import com.atlassian.jira.issue.UpdateIssueRequest; def x=5 if(x='5'){ MutableIssue issue=issue Long remain=0 issue.setEstimate(remain) IssueEvent event; def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() ComponentAccessor.getIssueManager().updateIssue(currentUser, issue, EventDispatchOption.ISSUE_UPDATED, false); }
thanks
DaractualData.PNGzeroRemainHistory.PNG
Community moderators have prevented the ability to post new answers.
In order to make sure JIRA's business logic is followed, you really ought to use the IssueService to update the issue, rather than the IssueManager. See https://answers.atlassian.com/questions/261412 for an example of something very similar. You'd want to do most of what they did, only instead of using the validateTransition and transition methods to move an issue through a workflow, you should use validateUpdate and update.
Also, instead of using setEstimate, you should use setRemainingEstimate on the IssueInputParameters.
Works great!!
thanks a lot Jonny!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it's the setting of your estimate to 0 that may be messing up the charts. The point of an estimate is that you make it and measure the difference between estimate and actual later. As you're destroying the estimate, there's nothing it can do.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
not sure what you mean- what different does it makes if the user set the remaining to zero or that it done by script?
actually the remaining setting to zero reflect great in the chart is the side affect that fire event that the original estimate was set to zero as well (which it didn't actually) that mess it up
is there a way to set the remaining without affecting the original?
thanks
Dar
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.