This tutorial will take you through the steps needed to create a new issue in another project and transfer the information needed, once your original request is resolved.

Use Cases:

  1. When a user raises a bug report, if it is verified, you want to automatically add it to your backlog in your development project.

  2. When a request for an item is approved by your manager, you want it to be placed in another project so that the appropriate team can can acquire it.

  3. When a person has been successfully hired, you want to auto raise a ticket to IT so that their login and basic IT is provided for them.

  4. When an incident has been fixed and you need to file a Root Cause Analysis(RCA) ticket in another project.


We need to setup a "Clones an issue, and links" postfunction in the transition that closes your ticket.

1. Set up the condition:

a): the request type is the one pertinent to us. In this case "Bug Report"

b): the transition to closed with a resolution that implies that you are going to do something with that ticket. In this case "Bug Reproduced"

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.servicedesk.api.requesttype.RequestTypeService
import com.onresolve.scriptrunner.runner.customisers.WithPlugin

def requestTypeService = ComponentAccessor.getOSGiComponentInstanceOfType(RequestTypeService)

if ( == "Incident") {

    def sourceIssueRequestTypeQuery = requestTypeService
    def requestTypeEither = requestTypeService.getRequestTypes(currentUser, sourceIssueRequestTypeQuery)

    if (requestTypeEither.isLeft()) {
        log.warn "${requestTypeEither.left().get()}"
        return false

    def requestType = requestTypeEither.right.results[0]

    if ( == "Bug Report" && == "Bug Reproduced") {
        return true

return false

2. Setup the other fields.

Setup the target project, target issue type and fields to copy.

postfunction copy
This is example, you could choose to copy the whole issue if you wish

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.