Jira Automation: Clone issue to another project and select project
Asked by Josh Allen:

Our dev team has a few dozen Jira projects, one for each microservice - we'll use "PAY" as an example jira key for one of those. They use a single Jira project as their main board (MAIN as the key) and have the filter setup to view all projects in that single project board.

A review ticket gets created each sprint within the specific Jira project (PAY) so that all the work is tracked in the appropriate place, sometimes multiple review tickets get created in multiple projects. They do this for each sprint for whatever microservice they are working on.

I'd like to setup a template jira issue (in MAIN for exampel) in which they can just clone into the appropriate project, but i'm not sure how without having to specifiy each project. In the Clone Issue automation you're required to select the project. Seems like I'd have to set this up within each microservice jira project.

Was trying to think of a way to pull some sort of information from within the ticket like a label or something so that it gets moved to the appropriate project.

Any help is greatly appreciated and happy to provide more details.


Answers:
author: Bill Sheboy
body: Hi [@Josh Allen](/t5/user/viewprofilepage/user-id/1180750)

The create issue and clone issue actions for automation require selecting the project, as you note. And, I recall there is currently no REST API clone issue function.

Some possible workarounds are:

1. List of if / else clauses to name each project in the clone action (as you described)
2. Using the Send Web Request action and REST API functions, get the existing issue data and then create the issue, supplying the project in the JSON. Copying things like attachments will be more difficult (or not possible) with this approach.
3. Write your own clone service outside of Jira, and call that from the rule

Kind regards,  
Bill

comments: author: Josh Allen
body: Good ideas, thank you Bill. I'll see how far i can get.


author: Josh Allen
body: Okay, i feel closer but not quite.

The first automation works great. In my template issue I add the label SEAP and it will clone the issue into the appropriate project. However, my branching doesn't seem to work. If i add the label ADB instead of SEAP, the audit log says "No Actions Performed". Probably i don't understand how branching works.

Any thoughts?

So looks like this:

![Screenshot 2024-05-16 at 11.19.21?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/324207i29A832427240E95B/image-size/large?v=v2&px=999 "Screenshot 2024-05-16 at 11.19.21?AM.png")


author: Josh Allen
body: I also tried this but same result, no action performed.

![Screenshot 2024-05-16 at 11.49.50?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/324229i422EF320DE583C1E/image-size/large?v=v2&px=999 "Screenshot 2024-05-16 at 11.49.50?AM.png")


author: Bill Sheboy
body: Are you trying to check for label values of SEAP or ACH?

If so, I believe your rule needs a different structure so it does not halt after the first condition test:

* trigger: manual
* branch: to current issue
  * condition: labels contains SEAP
  * action: clone issue...into "SF Event to API Proxy"
* branch: to current issue
  * condition: labels contains ACH
  * action: clone issue...into "ACH Processor"

This allows each branch to proceed and the conditions to succeed or fail without impacting the others.


author: Josh Allen
body: YES! Thank you. That was it.

The only thing, or most simple thing, i could do was have a template issue, then add the label for the appropriate project, then run the automation so it clones into that project.

This is great. Appreciate the help.


Tags: cloud

jira

jira-cloud