The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Upgraded to 8.18.2 and we have a bunch of scriptrunner scripts broken due to ComponentManager

Jeremiah Cargill
August 23, 2021

How do I convert the Script that was working below?

 

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.component.ComponentAccessor;
import org.apache.commons.lang.time.DateUtils;
import java.text.SimpleDateFormat;
import java.util.Date.*;

if (issue.isSubTask()){

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/YYY");

def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Launch Date Site")
if (cf) {
def result = issue.parentObject.getCustomFieldValue(cf);
if (result){
return sdf.format(result);
} else {
return
}
}
return
}

return

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 23, 2021

You've run into one of the things documented at https://scriptrunner.adaptavist.com/latest/jira/releases/UpgradingToJira8.html - that doc has lots of fixes for other things you may hit as well as this one.

DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events