How to detect via script listener if an Issue was cloned

Abbas April 10, 2017

We are using a script listener in JIRA to generate and store a value in the Issue. The script is executed after creating and updating an Issue. But after cloning it is not possible to differentiate between Issue creation and Issue cloning. The information whether the Issue is a clone or not is not available when the listener for the Issue creation runs. There is also no event for linking an Issue available.

Is there a possibility to detect in JIRA if an Issue was cloned?

2 answers

0 votes
Amir Katz (Outseer)
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.
September 27, 2018

Reading the various threads about this problem/need (which I am facing as well), I wonder whether there is already a feature request to Atlassian to provide a reliable means to detect it.

IMO, the simplest way would be to add a new system field (possibly called "Issue was cloned", or any other name), which would be a radio-button or single-select and will be set to "true" on clone, to "false" on creation.

Then a post-function on Create transition can simply check this field...

Amir

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 10, 2017

Only if it is specifically logged, and that information not lost.

By default, a cloned issue is usually amended such that

  • It is linked back to the issue it was cloned from with a "clone of" type link
  • The summary is prefixed with "Clone -"

So, in theory, you can look for one or both of those.

But, the automation can be changed or turned off, and also the effects could be removed by editing the issue.  The only place you'll be able to reliably tell is by reading the history of the issue.  When cloned, you won't see anything, but you'll be able to see if one or both of the automated clone flags used to be set if someone removes them.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events