Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to clone an issue that has links to other Jira issues using the Jira CLI app in the Jira Cloud instance.

...

For this scenario, we would need to use the cloneIssue and copyLinks CLI actions. 

  • cloneIssueCreate a new issue by copying an existing issue. By default, if the issue is a subtask, it is cloned to the same parent. Specifying the parent parameter will allow a subtask to be cloned to a different parent. By default, cloned issue is not linked to the original issue. For example, adding '--link Cloners' will add the normal clone link.
  • copyLinksCopy issue links when cloning an issue.


  1. Ensure that the issue that needs to be cloned has linked issues and subtasks. The below example shows an issue being cloned within the same project, T1ZJIRACLONE, that has two linked issues T1ZJIRACLONE-1 and DEMO-2. 
    Image RemovedImage Added


  2. Execute the below CLI action

    Code Block
    themeMidnight
    --action cloneIssue --project "ZJIRACLICLONEZJIRACLONE" --issue "ZJIRACLICLONEZJIRACLONE-6" --copyLinks --copyComments --copySubtasks


  3. The result of the above code block is as follows:


    Output on the terminal:

    Code Block
    themeMidnight
    titleOutput on the terminal:
    --action cloneIssue --project "ZJIRACLICLONEZJIRACLONE" --issue "ZJIRACLICLONEZJIRACLONE-6" --copyLinks --copyComments --copySubtasks
    
    1 comments copied to ZJIRACLICLONEZJIRACLONE-9. 
    1 subtasks copied as children of ZJIRACLICLONEZJIRACLONE-8. 
    Issues ZJIRACLICLONEZJIRACLONE-8 and ZJIRACLICLONEZJIRACLONE-1 linked with type 'is blocked by'.
    Issues ZJIRACLICLONEZJIRACLONE-8 and DEMO-2 linked with type 'relates to'.
    2 links copied to T1-8. 
    1 comments copied to T1-8. 
    Issue T1-6 cloned to T1-8.



    Output in Jira:
    Image RemovedImage Added


Info
  • This article applies to the Cloud environment. It can also be applied to the Server environment by changing the acli.properties file with appropriate credentials. 
  • It is recommended to test this scenario in a test environment before implementing it in production. 
  • Make sure that the acli.properties file, if it is CLI v9.0 and above

...