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

Some Groovy Classes Backwards-incompatible (ScriptRunner upgraded to 5.6.7)

For CloneIssue, it was enough for me to replace :

def params = [
issue : issue,
(CloneIssue.FIELD_TARGET_PROJECT) : issue.project.key,
(CloneIssue.FIELD_SELECTED_FIELDS) : null, //clone all the fields
] as Map<String, Object>
new CloneIssue().doScript(params)

with:

MutableIssue newIssue = ComponentAccessor.issueFactory.cloneIssueWithAllFields(issue)
newIssue.created = new Timestamp(System.currentTimeMillis())
Map<String,Object> newIssueParams = ["issue":newIssue] as Map<String,Object>
ComponentAccessor.issueManager.createIssueObject(issue.creator , newIssueParams)

Not sure how it worked for CreateSubTask. Here is a code snippet from my script:

MutableIssue newSubTask = ComponentAccessor.issueFactory.issue
newSubTask.setAssignee(ComponentAccessor.jiraAuthenticationContext.loggedInUser)
newSubTask.setSummary("Subtask for " + issue.key )
newSubTask.setDescription("Navigate to parent (eg. just click: [" + issue.key + "]) for details")
newSubTask.setParentObject(issue)
newSubTask.setProjectObject(issue.projectObject)
newSubTask.setIssueTypeId(ComponentAccessor.constantsManager.allIssueTypeObjects.find{ it.getName() == "Sub-approval"}.id)
// Add any other fields you want for the newly created sub task
Map newIssueParams = ["issue" : newSubTask] as Map
ComponentAccessor.issueManager.createIssueObject(ComponentAccessor.jiraAuthenticationContext.loggedInUser, newIssueParams)
ComponentAccessor.subTaskManager.createSubTaskIssueLink(issue, newSubTask, ComponentAccessor.jiraAuthenticationContext.loggedInUser)

I hope it helps :)

0 comments

Comment

Log in or Sign up to comment