Jira: Increase summary Iteration number when issue is cloned

miller j November 6, 2017

Hi,
I'm cloning an issue using the Clone and link issue post function every time the issue is closed.
I have the summary getting copied from the source issue, but I need the iteration number to be added to the summary every time the issue is cloned.

ex:
1st issue: summary: Text Iteration 0
when issue is cloned once, summary: Text Iteration 1, again when issue is cloned summary: Text Iteration 2 and so on.

Any help is appreciated.
Thanks.

1 answer

0 votes
adammarkham
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 Leaders.
November 8, 2017

If you use the following code in the "Additional issue actions" field the number will be incremented in the cloned issue.

def matcher = issue.summary =~ /\d+$/

if (matcher[0]) {
def num = (matcher[0] as long) + 1

issue.summary = sourceIssue.summary.replaceAll('\\d+$', num.toString())
}
miller j November 8, 2017

Thanks Adam, will try this.

Suggest an answer

Log in or Sign up to answer