Hi All,
I am trying to store the tranistion history details of an issue to a custom field through workflow post-function script.
ChangeHistoryManager changeHistoryManager = ComponentAccessor.getChangeHistoryManager() SearchService searchService = ComponentAccessor.getComponent(SearchService.class); JiraAuthenticationContext jiraAuthenticationContext = ComponentAccessor.getJiraAuthenticationContext() changeItems = changeHistoryManager.getAllChangeItems(issue) def logs = changeItems.findAll{it.getField()=='status'}.each{" ${it.created}; ${it.getFrom()}; ${it.getTo()}\r\n"} log.warn (logs)
Getting below output while running this script
com.atlassian.jira.issue.changehistory.ChangeHistoryItem@36b22288, com.atlassian.jira.issue.changehistory.ChangeHistoryItem@a9ecae02, com.atlassian.jira.issue.changehistory.ChangeHistoryItem@2ca7697, com.atlassian.jira.issue.changehistory.ChangeHistoryItem@c4b84838]
Could you please suggest how to convert these to exact tranistion history values?
Community moderators have prevented the ability to post new answers.
https://docs.atlassian.com/jira/6.4.3/com/atlassian/jira/issue/changehistory/ChangeHistoryItem.html
Look at getFromValue, getToValue etc.
Just tried with changeItems = changeHistoryManager.getAllChangeItems(issue) def logs = changeItems.findAll{it.getField()=='status'}.each{" ${it.created}; ${it.getFrom()}; ${it.getTo()}\r\n"} def test = logs.getFromValue() log.warn (logs) log.warn (test) But still getting error - Caused by: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.getFromValue() is applicable for argument types: () values: [] Can you please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exception speaks right. You try to invoke getFromValue() on ArrayList<ChangeHistoryItem>. Try invoke it on singular element, in this case inside each closure: it.getFromValue()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
+1. Exception speaks right, I like that.
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.