Behind the scenes of gd.initFromClone


When gd.initFromClone is true, rows associated to the original issue will be duplicated. This page details out how this works and why we need a custom field 'originid'

 

Why do we need an OriginID ?

JIRA has no API to determine the original issue id when an issue is cloned, but it clones all information contained in custom fields.
Because of the fact that the data contaiined in a grid is stored in an external table (outside of the regular JIRA data structures) or even
in an external database, we needed a way to detect that a newly created issue is being cloned.

The OriginID allows us to do so. and as follows 

When an issue is created a table grid editor specific listener is triggered which implements following logic

 

 

Notes

 

  • There is no need to put this field on an issue screen
  • The originID will always contain the id of the issue itself
  • Issues which have been created before the availability of the OriginID will not support the initFromClone functionality
  • OriginID can be programmatically set triggering a initfromclone functionality
  • When gd.initFromClone is true and the grid is initialized by duplication, gd.query functionality is disabled.