Ticket history scripted field code is not working in cloud

indra
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!
December 18, 2023

Hi Team,

We have migrated from DC to the cloud, we have a scripted field in DC, but we are not getting the script for the cloud. below is the DC 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();

 

Thanks,

Indra

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events