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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,456
Community Members
 
Community Events
176
Community Groups

How to script the Move Issue Wizard using JavaScript ?

Edited

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

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

0 votes
Darryl Lee Community Leader Apr 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.

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

Thanks, I'll look into the CLI!

0 votes
Mark Segall Community Leader Apr 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.

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

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

Atlassian Community Events