in JIRA UI (Issue View) history everything is OK
but when I am accessing the History Bean in a script I get null in from and too values
although the values are presented in the History list
same code show values of other Custom Fields
any insight on that?
This is the Code:
def HistoryOfCurrentIssue = ComponentAccessor.getChangeHistoryManager().getAllChangeItems(issue)
def LastChangeOffIssue = HistoryOfCurrentIssue.listIterator()[HistoryOfCurrentIssue.size()-1]
def StringToOutPut = LastChangeOffIssue.created.toString()+"/"+LastChangeOffIssue.getFroms().values().toString()+"/"+LastChangeOffIssue.getTos().values().toString()+"/"+LastChangeOffIssue.getField()+"/"+LastChangeOffIssue.getUserKey()
return StringToOutPut
Line 1 & 2 get the last History Bean of the issue (assume an issue is known)
line 3 - extract the data from the bean and prepare a string to print
line 4 - print the string
This is the Result:
format is <date>/<from value>/<to value>/<field changed>/<user that made the change>
in this case from value and to value are null
and this is how it shows in the UI
as you can see from value and to value are not null
Hi @Avi Bachar
I recommend for you using the following script instead
import com.atlassian.jira.component.ComponentAccessor def changedItem = ComponentAccessor.getChangeHistoryManager().getAllChangeItems(issue)?
this will get all the changes and you can use something like the following to filter out the change date to a specific field
.findAll {it.field == PRIORITY}?
Regards
Mohamed Adel
how this is adding to what I wrote?
I have no problem accessing the log and even get the history item I am interested in (the last one)
the problem is that in JIRA UI I see from value and to value in that item
but when retrieving this item in a groovy script (Scripted Field) I get null in from value and to value.
it happens for change history of Issue Picker - from Script Runner
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.