Retrieve previous issue number after moving issue between projects

Dimitris Sarris January 25, 2021

Hi,

When I move an issue between projects (eg. Project A --> Project B), Jira reassigns a new issue id, based on the new project's issue numbering. 

eg. A-1234 --> B-11

Jira redirects the user automatically when you search using the old issue id. I would like to know if there is a way to retrieve all the issue IDs that my issue had between projects. I would like to see in my scenario:

"A-1234, B-11" or only "A-1234"

Thank you in advance for your suggestions

Dimitris

 

3 answers

1 accepted

0 votes
Answer accepted
Daniel Ebers
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.
January 25, 2021

Hi Dimitris,

remembering from some earlier requirements it should still be possible to get the Key into a Scripted Field (this, though, would require an App called Script Runner) so at least you can display the former key in a custom field.

https://community.atlassian.com/t5/Jira-questions/Display-previous-key-of-moved-issue/qaq-p/406633

Needed code seems to have changed several times over the years but probably a start.

That means, like Jack, already said - you are restricted to how Jira works but could report the issue key in a custom field.

Regards,
Daniel

2 votes
Lawrence Walters June 2, 2022

You should be able to get this using the API call:

<server address>/rest/api/2/issue/<issue key>?expand=changelog

In the JSON that is returned, you'll see a changelog section, with a structure like this, which indicates the change in project and change in key.

"changelog": {

  ...

  "histories": [

    {
      ...

      "items": [

        {

          "field": "Key",

          "fieldtype": "jira",

          "from": null,

          "fromString": "A-1234",

          "to": null,

          "toString": "B-11"

        },

        {

          "field": "project",

          "fieldtype": "jira",

          "from": "...",

          "fromString": "A",

          "to": "...",

          "toString": "B"

        }

      ]

    }

  ]

  ...

}
0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2021

This cannot be achieved. The issue will be relabeled to be the latest issue number in the new project.

Suggest an answer

Log in or Sign up to answer