I've been beating my head against this wall and lots of searches have been unfruitful. I am trying to port over a simple scripted field from scriptrunner for jira server to one for jira cloud.
Here is the old script:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
def statusChanges = ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(issue, "status")
StringBuffer buffer = new StringBuffer();
for( com.atlassian.jira.issue.history.ChangeItemBean changeStatus : statusChanges )
{
String fromStatusId = changeStatus.getFrom()
String toStatusId = changeStatus.getTo()
buffer.append(changeStatus.getCreated().toString() + " : " + ComponentAccessor.getConstantsManager().getStatusObject(fromStatusId).getSimpleStatus().getName() + " -> " + ComponentAccessor.getConstantsManager().getStatusObject(toStatusId).getSimpleStatus().getName());
buffer.append("<br/>");
}
return buffer.toString();
How would I rewrite this in Jira cloud scriptrunner as I can find the field in the rest API but can't actually show the value. Thanks in advance!