Hello,
I have a script in workflow 'issue create' that checks if issue created manually or by clone:
def request = ActionContext.getRequest()
if (request)
{ log.warn "The issue created manually" return }
//clone issue
else
{ log.warn "The issue came from a clone action" }
I figured that if issue created by REST, the script returns 'null' like issue clone,
and I have to seperate those two option for creation.
How can I differentiate between creating issue via rest versus creating issue via clone using groovy script?
We would like do delete some copied field's values when the user clone an issue.
In REST issue we dont want to delete these fields's values.
Thank you,
Daniel
Hi @Dan27 , I do not think it is possible to check the way the issue was created in create transition.
But what about to try to use logic which will contain the rule that cloned issue is always linked with source issue with specific type of link by default? So you can
Hi @Martin Bayer _MoroSystems_ s_r_o__ ,
Thank you for your answer.
In issue created event listener, you can't find the links of the issue yet, I already tried it..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hm ok @Dan27 so what about to use https://docs.atlassian.com/software/jira/docs/api/7.6.0/com/atlassian/jira/event/issue/link/IssueLinkCreatedEvent.html?
I think clones link is not created manually often so it may be the basic filter...or you Can add check that for example timespan between issue was created and link was created is lower than 5s...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Martin Bayer _MoroSystems_ s_r_o__ ,
It has the same problem, in issue creation, the link didn't exists...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dan27 you have all needed information in IssueLinkCreatedEvent object. You can get issue link using getIssueLink() method and it contains sourceObject, destinationObject and issueLinkType (https://docs.atlassian.com/software/jira/docs/api/7.6.0/com/atlassian/jira/issue/link/IssueLink.html)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.