Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to script the Move Issue Wizard using JavaScript ?

Lucas Mendonça April 15, 2022

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? 

3 answers

0 votes
Mark April 27, 2022

@Mark Segall @Lucas Mendonça You mentioned the wrong Mark

Lucas Mendonça April 27, 2022

Oops! sorry

0 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2022

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)?

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 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.

Lucas Mendonça April 27, 2022

Hi @Darryl Lee 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


Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2022

Hi Lucas - ah sorry that I didn't catch that you were on Server, not Cloud. Automation 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 has a 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.

Lucas Mendonça April 27, 2022

Thanks, I'll look into the CLI!

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2022

Hi @Lucas Mendonça 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.

Lucas Mendonça April 27, 2022

Hi, @Mark 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.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2022

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.

Like Lucas Mendonça likes this
Lucas Mendonça April 27, 2022

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events