I want to update Original Estimate field using Groovy in Scriptrunner that way changes will not appear in history.
I guess I need to retrieve TimeTrackingSystemField and use updateValue method, but i don't know what the code should be look like.
Hi,
I didn't test it but it should be something like this
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
MutableIssue mutableIssue=issue
mutableIssue.setOriginalEstimate(3600)
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
ComponentAccessor.getIssueManager().updateIssue(currentUser, mutableIssue, EventDispatchOption.DO_NOT_DISPATCH, false);
If it's not working, you should at list be able to manage your way from here :)
Hello,
thanks for you kind help, but this method updates issue and traces changes in history.
I know that customfield.updatevalue() method does what i want, but it's for custom fields, not for TimeTracking field.
In documentation I saw a matching method
updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)
, but there is 2 problems:
1. I dont know how to retrieve this field for an issue
2. And what modifiedValue should look like
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this code:
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
def issueManager = ComponentAccessor.getIssueManager()
MutableIssue issue = issueManager.getIssueObject("KEY-1")
issue.setOriginalEstimate(3600)
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
issueManager.updateIssue(currentUser, issue, EventDispatchOption.DO_NOT_DISPATCH, false);
this does update the original estimation (but also update the history)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as far as i know, there is no way to update Jira ticket without history...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually customfield.updatevalue() updates values of issue without history :)
And TimeTrackingField has same method, but i dont know how to use it
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.