Forums

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

How do I convert a scripted field with scriptrunner from server to Jira 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!
October 27, 2023

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!

1 answer

0 votes
Rilwan Ahmed
Community Champion
October 27, 2023

Hi @indra ,

Welcome to the community !!

Refer official documentation on how to migrate scripts from server to cloud in https://docs.adaptavist.com/sr4js/latest/scriptrunner-migration/migrating-to-or-from-cloud/migrate-from-scriptrunner-for-jira-server-to-cloud

If you still have concerns, please contact the plugin vendor for assistance through https://www.adaptavist.com/contact?_ga=2.131204362.406165589.1698412308-1430461644.1698226738

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events