Forums

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

Get first value ever of a select list field for an issue

Mihai Mihai
Contributor
June 12, 2019

Hello,

 

Using Scriptrunner, we would like to create either a scripted field or a listener that will set in a single select list field the first value that was ever set on another single select list field.

How could I get the first value ever used on an issue for a specific field?

 

Thank you!

2 answers

1 accepted

1 vote
Answer accepted
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.
June 20, 2019

Use a changHistoryManager to get all the changeHistory objects for the issue, searching them for changes to the field.  If none are found, the current value is the first use, but if you do find some changes of the field, use the changeHistory that contains the change of field with the earliest date.

Mihai Mihai
Contributor
June 20, 2019

Thank you!

0 votes
Tarun Sapra
Community Champion
June 12, 2019

Hello @Mihai Mihai 

Could you please elaborate the business case behind your requirement?

Mihai Mihai
Contributor
June 17, 2019

Hello @Tarun Sapra 

We have a select list field that should help set a value for the program increment in which an issue is planned. 

We want to be able to compare the first value in which an issue was planned with the one it is currently in, to see deviations from the original plan.

Thank you!

Suggest an answer

Log in or Sign up to answer