Hi Guys,
I'm trying to write a post function condition using groovy scriptrunner. What I want to achieve is the following:
* When a request is created on service desk, a clone should be auto-created and linked to the main request, and then based on the Issue type selected then the clone should be moved to another project. For example if a task issue type is selected then the clone must be move to Project1 and if bug issue type is selected then the clone must be moved to Project2 and so on.
I've realized that through the built-in scripts I can achieve this, however I can only select one destination project.
Kind regards,
Oupa.
Hi @Oupa Monareng,
I am not good at scripting so i will not be able to help you with a script.
But, there are other ways of solving it if you do not find a solution with a script. You could do it with automation for jira plugin.
An extra advantage is that when you upgrade your jira instance, you would not need to check your script and adapt it if some function is deprecated.
Regards
Dave
Thanks for your reply Dave, I will considering this plugin as a last resort simply because the costs are ridiculously expensive and since we're already using Scriptrunner I wanted to exploit the functionalities.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I understand your point of view, I just wanted to give you an alternative in case you can't find a solution with the scriptrunner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Nir said, yes, it is hard to do it with Scriptrunner. This has to do with the fact that the JIRA API doesn't offer a straightforward way of doing this.
However, it might be a lot easier to clone your issue to another project and linking it, instead of "moving the issue". You can do this by:
My suggestion would be that you ignore step 2, to be honest. The clone issue will link it to your original project for easy reference.
If you need any further clarification, let me know, I'd be glad to help.
Cheers
DY
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi DY,
Thanks for your response, I have tried using the cloneissue postfunction which clones the original issue and then links the 2 issues, then assigns the clone to a different project, which works perfectly. The only limitation is that you can only select a single target project and in my case I need to have multiple target projects which can be associated through a selection based on a custom unique identifier or perhaps issue type.
Kind Regards,
Oupa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is very hard to move issue with ScriptRunner.
I would suggest you @Dave Bosman [Realdolmen] solution with automation for jira plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online 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.