Forums

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

Programmatically copying Sprint information from one issue to another

Aris Kourtesas
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 31, 2019

Right now I'm in the process of creating a custom script using ScriptRunner that duplicates an existing issue, alters some of it's fields and creates a new one.

One of the things I'd like to is to preserve the Sprint information of a given issue.

To do that I tried the following:

def sprintField = customFields.findByName('Sprint')

 I'm attempting to get the custom Sprint field using the above command and the using the IssueService I attempt to fill in the information via parameters this way:


if (sprintField != null) {
params = params.addCustomFieldValue(sprintField.id, [(issue.getCustomFieldValue(sprintField) as ArrayList<Sprint>).collect { it.getId().toString() }
.toArray(new Long[(sprintField.getValue(issue) as ArrayList<Sprint>).size()])] as String[])

Unfortunately this does not seem to work. Can anyone shed some light as to how I'm supposed to do that?

0 answers

Suggest an answer

Log in or Sign up to answer