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.ComponentAccessorimport com.atlassian.jira.event.issue.IssueEventimport com.atlassian.jira.event.type.EventDispatchOptionimport com.atlassian.jira.issue.MutableIssueMutableIssue mutableIssue=issuemutableIssue.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
Hi @Sesegma Tsydypova
I tried this code:
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.event.issue.IssueEventimport com.atlassian.jira.event.type.EventDispatchOptionimport 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)
as far as i know, there is no way to update Jira ticket without history...
It looks like you're new here. Sign in or register to get started.