How to get issue key in clone issue and links post function?

Tsol
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.
March 30, 2014

Hi everybody,

i'm using clones issue and links post function from groovyrunner plugin. I want to pass the issuekey in the summary of new linked issue.

In additional issue actions field i have the following

log.warn("key: " + issue.getKey())

But from logs i see that i get a null value.

Any idea how can i get the issue key?

Thanks in advance

1 answer

1 accepted

1 vote
Answer accepted
JamieA
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.
March 31, 2014

try:

transientVars["issue"].key

This should give you the key of the issue that you are cloning from.

Tsol
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.
March 31, 2014

That's it.

Thanx a lot

Dan Goldman October 8, 2014

What if you wanted to get the key of the issue you have just created as result of cloning? That is, the new issue key?

JamieA
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.
October 9, 2014

In recent version it's available as *sourceIssue*

Brian Bishop
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.
July 24, 2015

When I try to access this I get a null pointer exception log.debug("DBG: issue key is " + transientVars["sourceIssue"].key)

JamieA
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.
July 27, 2015

Brian - what version of the plugin are you using?

JamieA
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.
July 27, 2015

Suggest an answer

Log in or Sign up to answer