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

Still need help?

The Atlassian Community is here for you.

Ask the community

robotsnoindex


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Purpose

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:

  • 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:

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

      {
         "fields":{
            "Customer Request Type":"hd/46d6141f-a6ba-486a-a989-d67be7f760d1"
         }
      }
    2. To find the customer request type guid, please run the following SQL query: 

      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
    3. 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>"
      • portal_key = hd
      • request_guid = 46d6141f-a6ba-486a-a989-d67be7f760d1
    4. 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.


Description
Product

Last modified on May 30, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.