JIRA-CLI cloneProject, keep issue key numbers?

Marcel Montel August 15, 2016

I am using JIRA Cli from Bob Swift. When i try to clone a project with cloneProject it succeeds but i expected the issuenumbers to be the same in the cloned project. Is this possible? Can Bob Swift answer if he's around? =)

 

eg:

java -jar jira-cli/lib/jira-cli-5.5.0.jar --server $JIRA_SERVER --user $JIRA_USER --password $JIRA_PASSWORD \
--action cloneProject --project $PROJECTKEY --toProject $NEW_PROJECTKEY --name "$NEW_PROJECTNAME" --cloneIssues \
--continue --verbose

now FOO-1 is not the same issue as BAR-1, FOO-2 is not the same issue as BAR-2 and so forth.

 

Edit: The original project had lots of subtasks which are now deleted so FOO-2 to FOO-6 does not exist, so the skew appears whenever a issuekey is not avaible in sequence in the first project.

eg.
FOO-1 > BAR-1

FOO-2 to FOO-6 does not exist so FOO-7 is then BAR-2..

 

1 answer

1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 15, 2016

No, not without doing additional scripting to fill in holes in the number sequence. I have done this as part of a migration many years ago. It is pretty straight forward. The logic is something like the following assuming the target project does not have issues:

  1. Use getIssueList to get the source project's issue in ascending order
  2. Loop through each issue from the list
    1. If there is a hole in the issue number sequence, then create a dummy issue and then delete it
    2. If there isn't a hole, just create the new issue (probably using cloneIssue) 

 

Marcel Montel August 17, 2016

@Bob Swift [Bob Swift Atlassian Add-ons]

Hi, thanks for your answer. Perhaps you can help once again

The source of the problem i'm trying to get around is that cloneProject (and i assume cloneIssue) does not copy the issue (entity) properties. We are using issue-checklist plugin that stores its data in issue/${issue}/properties/cachedchecklist but i have not found any way to make jira-cli include these properties upon cloning. 


Is there something i have overlooked?

BR
Marcel

no_longer_in_sudoers_file
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2016

Test comment in response to a report that the editor is not working.  Please disregard.  

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 17, 2016

Ok, I can comment now finally.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 17, 2016

Marcel, clone issue does not copy properties yet. I opened JCLI-1032 to track this request. Thanks for the requirement.

Suggest an answer

Log in or Sign up to answer