How to clone issue and update customer request type using Automation for Jira

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Clone issue and update the target clone ticket customer request type using Automation for Jira rules.

Solution

  • Configure the automation rule to look like this:

Restrict to Projects
  • In the Rule details, please restrict to the source and target projects. For example:

    • SDS = source project

    • HD = target project

  • In the Edit issue fields action, please set the JSON format to look like this:

Set JSON format

a. As you can see the "Customer Request Type" field is set to the GUID = "hd/46d6141f-a6ba-486a-a989-d67be7f760d1"

1 2 3 4 { "fields":{ "Customer Request Type":"hd/46d6141f-a6ba-486a-a989-d67be7f760d1" }

b. To find the customer request type guid, please run the following SQL query:

1 2 3 4 5 6 7 select vp."KEY" as portal_key, vp."NAME" as "project name", vpf."KEY" as "customer request type guid", vpf."NAME" as "customer request type name" from "AO_54307E_VIEWPORT" vp join "AO_54307E_VIEWPORTFORM" vpf on vp."ID" = vpf."VIEWPORT_ID";

Results:

portal_keyproject namecustomer request type guidcustomer request type name
sdsSDS0e956422-5193-4ed3-8305-09720410a444Test
sdsSDSaa229e33-81e0-4e7d-908b-dc50cf1a6231Test
hdHD46d6141f-a6ba-486a-a989-d67be7f760d1Test Block
hdHD59c26ee0-f5d6-44fc-8f7d-19cf1f619486Test Accept

c. In this scenario, I'm looking to set the customer request type to "Test Block" on the clone issue. The guid would be "<portal_key>/<request_guid>"

  1. portal_key = hd

  2. request_guid = 46d6141f-a6ba-486a-a989-d67be7f760d1

d. Save the automation rule and proceed with the test in your Test environment.

Troubleshooting

Automation rule does not work:

  • The automation rule trigger when transitioning an issue. Check if you use other triggers such as manual triggers to test the results.

  • Check the Audit log if you have seen any errors. Sometimes, you can see the failure could be related to the incorrect customer request type guid.

  • The automation rule might be restricted to a single project. Please check the rule details to allow multiple projects and select all the related projects.

  • SQL results above might be different when you run on different Jira environments such as production and dev environments. Please verify the request type guid and portal key before implementing it in production.

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.