Automatically adding versions using Versions.groovy

Originally asked by Peter Hochstrasser on 14 September 2019 (original question)


While there seems to be ample documentation about how to use Versions.groovy, it seems that it is quite important to put those send() and receive() calls at the right place.

What I have seen is that the calls need to be placed as follows:
- the project key of the sender or receiver project have been defined already, i.e. issue.projectkey is defined
- in the incoming sync in front of the receiving version related field assignments

Is that all that needs to be accounted for?
Source: Jira Server/Datacenter (old community)


Answer by Francis Martens (Exalate) on 14 September 2019

Yes,

That’s correct - (need to nudge the documentation)

The reason is to be found in the source code of Versions.groovy

The projectKey is required to know what set of versions need to be used, or in what project the version needs to be created

Thanks for hightlighting