Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to update original estimate using Groovy in Jira without changes in history?

Minahil Malik
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 26, 2021

I want to update Original Estimate field using Groovy in Scriptrunner that way changes will not appear 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 at Calvindude

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 in code

2 answers

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2021

You can use issue.setOriginalEstimate() to set it on an issue instead of customfield.updatevalue()

And that leads to the assumption for me that issue.getOriginalEstimate answers your first problem (An assumption that I did just look up too, it's right)

The modified value is a pair of values, old and new, for the field being modified, so the old-value would be whatever you get from .getOriginalEstimat, and the new, the same type of data, changed in the way you want.  (I am not sure I remember what original estimate thinks in, but I think it is seconds, and the value a long, so an estimate of 1 minute would be simply 60 (long) and a new value of 1 hour 3600 (long) )

0 votes
Hana Kučerová
Community Champion
September 26, 2021

Hi @Minahil Malik ,

welcome to the Atlassian Community!

The change is always done in the name of some user, so I don't think it's possible to do it without change in the history.

When do you what to do the change? Should this be a post function or something else?

And to which value you want to change it?

Thank you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events