Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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!
Oct 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 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
Site Admin
TAGS
AUG Leaders

Atlassian Community Events