Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find out if issue was cloned in create-post-function

Christian Vieweg July 9, 2018

Hi,

I'm working on a post-function, which is called at the end of the "create" transition. I need to know, if the issue is a clone of another issue, but the issue links are not yet stored in the data base and

issueLinkManager.getLinkCollectionOverrideSecurity(Issue issue)

returns an empty collection. Is there another way to find out, if an issue is a clone?

2 answers

1 accepted

0 votes
Answer accepted
Christian Vieweg July 10, 2018

The only way I found, was to check for the parameter "pkey" in the transientVars provided by the execute method.

transientVars.containsKey("pkey")

 This parameter is only set on create, not on clone. But I'd rather have a more reliable way to find out, if an issue was cloned or related...

Ritesh Shah December 26, 2018

Hi Christian,

How can we get "transientVars" parameter in issue create event?

transientVars.containsKey("pkey")
Christian Vieweg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 27, 2018

Hi,

you need to create a post function module. https://developer.atlassian.com/server/jira/platform/creating-workflow-extensions/

The "transientVars" are available in the execute method:

public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
}
1 vote
Alexey Matveev
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 9, 2018

Hello,

Try to put this post function last in the list of the post functions in the create transition

Christian Vieweg July 10, 2018

Hello,

thanks for your answer, but the post-function is already the last in the list

Suggest an answer

Log in or Sign up to answer