How to script the Move Issue Wizard using JavaScript ?
Asked by Lucas Mendon?a:

We are currently using Jira Server as a bug triaging solution, where we have a Triage project where a lot of issues are created every day. After analyzing the issues, the triage members select a Dev Team Project and move the issue using the Move Issue Wizard to its new project so it can be fixed.  

In order to bulk-move issues programmatically to their respective projects based on our previous triaging history, we plan on running an external script that uses the Jira REST API. However, I didn't find Move or even Clone in the API: <https://docs.atlassian.com/software/jira/docs/api/REST/8.22.2/#issue-createIssue>

We'd also like to avoid using script runner or marketplace plugins since all of our other scripts are written in JS and it gives us more flexibility.

Is there an alternative to complete the Move Issue Wizard step by step programmatically, with predefined values for each field, and then simulate the "Move" action through a JS script?


Answers:
author: Mark
body: [@Mark Segall](/t5/user/viewprofilepage/user-id/4667637) [@Lucas Mendon?a](/t5/user/viewprofilepage/user-id/4879612) You mentioned the wrong Mark

comments: author: Lucas Mendon?a
body: Oops! sorry


author: Darryl Lee
body: Does the Move Issue Wizard provide functionality that is not available in Automation, which is built-in to Cloud (although there are [limitations on number of executions based on your tier](https://support.atlassian.com/jira-cloud-administration/docs/explore-jira-cloud-plans/))?

As I recall it just prompts you if there are mismatches in issue types, transition steps, required fields, etc.

Atlassian has documented how to use the [Clone and Delete functions in Automation to do a Move](https://support.atlassian.com/cloud-automation/docs/move-an-issue-to-another-project-using-automation/) that could certainly be triggered and controlled by field values.

I guess if it's only Cloning though, you'd also make sure to have transition the "new" issue to the appropriate step.

So not completely painless, but at least it doesn't require running an external script \*or\* any Marketplace add-ons.

If you have issues with the rule, feel free to respond here.

comments: author: Lucas Mendon?a
body: Hi [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322) thanks for your answer, we're actually using Jira Server instead of Jira Cloud, my mistake.   

I've edited the question with better descriptions.  

We're looking for a scripting solution so we can bulk-move issues programmatically to their respective projects based on our previous triaging history, so running an external script is preferred so we can tweak the move criteria from time to time.

However, I didn't find Move or even Clone in the API: <https://docs.atlassian.com/software/jira/docs/api/REST/8.22.2/#issue-createIssue>  

<br />


author: Darryl Lee
body: Hi Lucas - ah sorry that I didn't catch that you were on Server, not Cloud. [Automation](https://marketplace.atlassian.com/apps/1215460/automation-for-jira-data-center-and-server?tab=overview&hosting=datacenter) is available as an add-on for Server, BTW.

Anyways, you're right that there is no Move or Clone actions in the API.

[Bob Swift's CLI](https://bobswift.atlassian.net/wiki/spaces/JCLI/overview?homepageId=6684681) has a [cloneIssue](https://bobswift.atlassian.net/wiki/spaces/JCLI/pages/1059365236/cloneIssue) command that you might be able to use in the same way that Atlassian recommends for Automation. (Clone and then delete.)

So it's possible you could build a script that calls the CLI.


author: Lucas Mendon?a
body: Thanks, I'll look into the CLI!


author: Mark Segall
body: Hi [@Lucas Mendon?a](/t5/user/viewprofilepage/user-id/4879612) and welcome to the community!

This isn't my area of expertise, but you may want to explore utilizing selenium or any other tools you may have for functional testing automation.

comments: author: Lucas Mendon?a
body: Hi, [@Mark](/t5/user/viewprofilepage/user-id/992133) thanks for your answer.  

We're currently looking for a scripting solution that doesn't require browser interaction since this is going to be used for bulk-moving issues in the background.


author: Mark Segall
body: Unfortunately, there is no way to manage bulk moving issues without the browser. There is no API for moving issues so you won't even find solutions on the marketplace. That's why I mentioned using something like selenium for automating the process through the UI.


author: Lucas Mendon?a
body: Oh :( I guess we would have to try something like that or create an issue and update it like a clone or something


Tags: api

javascript

move

script

server

triage

wizard