Forums

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

Move issues between project scheduled

Piyush_Annadate
Contributor
April 21, 2020

Hi,

Requirement: Move issues between projects.

Conditions: Based on JQL

Plugins available: Scriptrunner

 

Will there be a case wherein this can be done. Both the projects have the same workflow and set of fields and mandatory ones. If not by moving; any other method via we can clone them and delete them?

1 answer

1 vote
Nic Brough -Adaptavist-
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.
April 22, 2020

You can use Scriptrunner to move issues, but unless you replicate all the checks that Jira does, be aware that you could easily corrupt the issues or have the move fail completely and silently.  You'll also need to think very carefully of where you're going to run such a script - you can't do it in a workflow function (unless you're moving issues other than the current one that you are transitioning), and listeners etc would need triggering.

I would question why you want to script a move of an issue.  Generally, issue moves are for housekeeping or for when someone genuinely missed the right project or type.  Either way, not something you'd want to automate (script)

Piyush_Annadate
Contributor
April 23, 2020

Hi Nic,
Generally, the move from the UI should be best and even I agree that it would be challenging towards Atlassian to change the natural way to something else. Here; a process includes where we manually move the issues at the end of the day; for the same, we're looking for automation to be included to move the issues (which falls under criteria) to another project of the same structure. There will be a notification via mail - that code I already have; now the question would be the automation to make a move of issues between projects; and later is I'm not to known for the scripts in depth.

Nic Brough -Adaptavist-
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.
April 23, 2020

You really should change your process.  Why are you moving issues at the end of a day?  Do they really need to move to a different project?  What is the benefit of doing the move?  Move is clumsy, and is very unlikely to be of any real benefit.

Anyway, if you don't fix your process and still want to do this, you're going to need to work out some form of trigger that you can catch and put a "move issue" script behind.  Maybe an issue that you transition every day, and catch the event in a listener, or a web-fragment that triggers the script.

Then, your code will need to read all the schemes for screens, fields and workflows, check that they match in source and target, and then use the issuemanager to move the issue.

Piyush_Annadate
Contributor
April 23, 2020

This isn't a confirmed process for all- it's moreover a selected bunch of team to perform. In that case - I wanted to explore the rationale beyond the ScriptRunner usage. As stated earlier - it would be hard for me to develop the whole script; but getting the move issue code fragment could be beneficial for me to start.

Suggest an answer

Log in or Sign up to answer